Home / MAD1 / Week 12 / Real questions
33 questions pulled from past papers whose wording matches this week's topics, newest first, duplicates removed. Pick your answers, then press Check answers. Figures and answer keys are the originals.

Ingredients: <ol> | Cooking Steps: <ol>

Ingredients: `<ul>` | Cooking Steps: `<ul>`

Ingredients: `<d1>` | Cooking Steps: `<u1>`

Ingredients: `<ul>` | Cooking Steps: `<ol>`
What will be the response?File name: app.py
```python
from flask_restful import reqparse, Resource, Api
from flask import Flask
parser = reqparse.RequestParser()
parser.add_argument("n", type=int, required=True)
app = Flask(__name__)
api = Api(app)
class MyResponse(Resource):
def post(self):
args = parser.parse_args()
return args
api.add_resource(MyResponse, "/")
app.run(debug=True)
```
Assume that the Flask app is running at http://127.0.0.1:5000. The client sends the below CURL request in the git bash terminal.
```bash
curl -X POST http://127.0.0.1:5000 -H "Content-Type: application/json" -d "{\"n\":3}"
```
Which of the following will be the correct rendered output ?```html
<!DOCTYPE html>
<html>
<head>
<style>
.container{
display: flex;
width: 250px;
border: 2px solid black;
}
.box{
width: 80px;
height: 40px;
border: 1px solid blue;
margin: 5px;
text-align: center;
}
</style>
</head>
<body>
<div class="container">
<div class="box">1</div>
<div class="box">2</div>
<div class="box">3</div>
</div>
</body>
</html>
```
This is a diagram showing three rectangular boxes stacked vertically within a larger outer rectangle. Each inner box is outlined in blue and contains a single number. - The top box is labeled "1". - The middle box is labeled "2". - The bottom box is labeled "3".

This is a diagram of a rectangle with a nested rectangle. The outer rectangle is black. The inner rectangle is blue. Inside the inner rectangle, the text "1 2 3" is displayed.

This is a diagram of three rectangular boxes arranged horizontally, each containing a number. - The first box on the left contains the number "1". - The second box in the middle contains the number "2". - The third box on the right contains the number "3". All boxes are outlined with a dark blue border, and the vertical lines separating the boxes are also dark blue.

The image displays a diagram with a black rectangular outer border. Inside this border, there are three smaller, identical rectangular boxes arranged horizontally. Each of these inner boxes has a blue border. The boxes are labeled with numbers: "1" in the leftmost box, "2" in the middle box, and "3" in the rightmost box. There is a small gap between each of the inner boxes.
converts a local folder into a Git repository.``` "git init" ```
moves the local repository to the remote repository.``` "git add" ```
Assume that the Flask app is running at http://127.0.0.1:5000. The client sends the below CURL request in the git bash terminal.
What will be the response?File name: app.py
```python
from flask_restful import reqparse, Resource, Api
from flask import Flask
parser = reqparse.RequestParser()
parser.add_argument("n", type=int, required=True)
app = Flask(__name__)
api = Api(app)
class MyResponse(Resource):
def post(self):
args = parser.parse_args()
return args
api.add_resource(MyResponse, "/")
app.run(debug=True)
```
```
curl -X POST http://127.0.0.1:5000 -H "Content-Type: application/json" -d '{}'
```
Which of the following statements are TRUE regarding the element's dimensions and spacing?```css
#container {
width: 200px;
padding: 10px;
border: 2px solid black;
margin: 15px;
}
```
``` git merge feature1 then git merge feature2 ```

``` git checkout feature1 then git merge feature2 then git merge main ```

``` git checkout feature1 then git merge feature2 then git checkout main then git merge feature1 ```

``` git merge feature1 then git checkout feature2 then git merge main ```

Consider the following statements and select the correct option. Statement 1: The `<span>` elements will start on new lines, while the `<div>` elements will appear inline with surrounding content. Statement 2: The `<p>` and `<div>` elements will each start on new lines and take up the full width of their container, while `<span>`, `<strong>`, and `<em>` will flow inline with surrounding content.

Consider the following HTML and CSS code:
```html
<html>
<head>
<style>
div {
width: 0px;
margin: 0px;
}
.container {
width: 200px;
padding: 15px;
border: 5px solid black;
}
#box {
margin: 10px;
}
</style>
</head>
<body>
<div class="container" id="box">Hello World</div>
</body>
</html>
```
What is the **total width (approximately)** of the `div` with `class="container"` and `id="box"`, including **content, padding, and border** but excluding margin?
Consider the following git branches for a remote repository. ``` feature1 * feature2 main ``` Choose the correct git command sequence to merge *feature1* and *feature2* into the *main* branch.

``` git merge feature1 git merge feature2 git merge main ```

``` git checkout feature1 git merge feature2 git merge main ```

``` git checkout main git merge feature1 git merge feature2 ```

``` git merge main git merge feature1 git merge feature3 ```

You are working on a team project hosted on GitHub. After making changes to your local files, you run the following commands in this exact order: ```shell git status git add . git commit -m "Fixed header bug" git push git pull ``` Assuming your teammate pushed a new change **just before** you did `git push`, what is the most likely outcome?

Your commit will be rejected because the remote branch is ahead of your local branch.

The `git pull` should have been run **before** `git push` to avoid possible conflicts.

The `git push` will automatically merge your changes with the remote and succeed.

The `git status` will show the conflict before `git push` is run.

Consider the following HTML code snippet.
filename: index.html
```html
<!DOCTYPE html>
<html lang="en">
<head>
<title>CSS Document</title>
<style>
.container p.highlight { background-color: red; }
.content .special { background-color: blue; }
span.highlight { background-color: green; }
</style>
</head>
<body>
<div class="container">
<p class="highlight">Welcome to our site</p>
<div class="content">
<p>This is regular content</p>
<p class="highlight special">Important information</p>
<span class="highlight">Notice</span>
</div>
<p class="highlight">Footer text</p>
</div>
<p class="highlight">Welcome to our site</p>
</body>
</html>
```
Which elements from the above document will have a red background color?
All elements with the class "highlight".

Only the `<p>` elements that are direct children of `.container` and have the class "highlight"

All `<p>` elements with the class "highlight" that are descendants of `.container`

Only the first `<p>` element with class "highlight"
Consider the following git branches for a remote repository.
``` feature1 * feature2 main ``` Choose the correct git command sequence to merge *feature1* and *feature2* into the *main* branch.

``` git merge feature1 git merge feature2 git merge main ```

``` git checkout feature1 git merge feature2 git merge main ```

``` git merge main git merge feature1 git merge feature3 ```

``` git checkout main git merge feature1 git merge feature2 ```

Consider the following HTML document:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<style>
#container {
border-style: dashed;
background-color: red;
}
.content {
border-style: solid;
border-color: green;
background-color: orange;
}
div {
width: 250px;
border: 3px dotted black;
border-color: yellow;
}
</style>
</head>
<body>
<div id="container" class="content" style="background-color: yellow;">
<h2>Welcome to Web Dev</h2>
</div>
</body>
</html>
```
How will the browser render the above HTML document?
Welcome to Web Dev

Welcome to Web Dev

Welcome to Web Dev

This is a screenshot of a web page element. It shows a red rectangular box with a dotted green border. Inside the box, the text "Welcome to Web Dev" is displayed in black, bold font.

``` git new-branch <branch_name> ```

``` git branch <branch_name> ```

``` git new <branch_name> ```

``` git create-branch <branch_name> ```

Consider the following statements and select the correct option. **Statement 1:** The command, `git del <filename>` deletes the file from the staging area as well as from the working tree. **Statement 2:** The command, `git rm --cached <filename>` deletes the file from the staging area but keeps it in the working tree.



``` git config email <new e-mail> ```

``` git config user.email <new e-mail> ```

``` git config --global email <new e-mail> ```

``` git config --global user.email <new e-mail> ```

``` git rm <filename> ```

``` git rm --cached <filename> ```

``` git del <filename> ```

``` git del --cached <filename> ```

Read the following statements regarding web accessibility principles and choose the correct option. **Statement 1:** The command `git merge <branch_name>` merges all the change done to currently active branch. **Statement 2:** The command `git merge <branch_name>` merges all the change done to master branch.
In the given HTML template, to correctly embed a URL in the href, the argument "user" in the "url_for" function must be a __________________? ```html
<a href = {{ url_for('user')}}>Click here</a>
```
Git is an example of a centralized version control system.

A file can stay in both working directory and staging area at a given time, while working with Git.

Git and GitLab/GitHub are essentially the same.

The command "git checkout -b <branch_name>" will create the new branch and switches to the new branch created.
Consider the table “production” in SQLite database given below: | Manufacturer | Product | Quantity | Cost | |---|---|---|---| | Industry A | Biscuits | 3 | 100 | | Industry B | Shoes | 2 | 500 | | Industry A | Chocolate | 10 | 200 | | Industry C | Pen | 20 | 50 | | Industry B | Shirts | 5 | 700 | | Industry D | Beverages | 30 | 150 | | Industry C | Notebook | 40 | 250 | What will be the output of the SQL query given below? ```sql SELECT Manufacturer, COUNT(*) FROM production WHERE Quantity>10 GROUP BY Manufacturer HAVING COUNT(*)=2; ```

``` | Manufacturer | COUNT(*) | |---|---| | Industry D | 1 | ```

``` Manufacturer|COUNT(*) Industry C |2 ```

``` Manufacturer|COUNT(*) Industry C |2 Industry D |1 ```

``` Manufacturer|COUNT(*) Industry C |1 Industry D |2 ```