Home / Past papers / MAD1 Quiz 1 / this paper

Consider a square matrix A given below. A = ``` ⎡ 12 21 25 ⎤ ⎢ 11 8 30 ⎥ ⎣ 9 19 17 ⎦ ``` Matrix B is another matrix whose elements represent the LSBs of binary equivalent of corresponding elements of matrix A. The determinant of matrix B would be __________.

Consider the image given below. Email or phone example.gmail@com ! Enter a valid email or phone number Forgot email? When a user enters an invalid email or phone number, an error message is displayed which clearly tells him/her about what went wrong. Which usability heuristic principle best describes the above behavior?

Consider the given URL below. ``` https://www.host.com/tutorials/what-is-a-domain-name ``` Select the appropriate option that correctly identifies different components of a given URL.

Protocol: https Domain: www Sub-Domain: host.com Path: /tutorials/what-is-a-domain-name

Protocol: https Domain: www Sub-Domain: host.com/tutorials Path: /what-is-a-domain-name

``` Protocol: https Domain: host.com Sub-Domain: www Path: /tutorials/what-is-a-domain-name ```

``` Protocol: https Domain: host.com /tutorials Sub-Domain: www Path: /what-is-a-domain-name ```

Let L = { 'a', 'b', 'c', 'd', 'A', 'B', 'C', 'D', '0', '1', ' ', ' '} be a complete character set (i.e., only these characters can be used to represent text in the document). If a document that uses fixed encoding for all characters is created using the character set L and has a disk size of 2 Kilobytes, the number of characters in the documents would be ______. [Take 1 Byte = 8 bits, 1 KB = 1000 Bytes, 1 MB = 1000 Kilobytes and so on.]
What will be the output of the following Python code snippet on the terminal. ```python
from string import Template
temp = "A student needs to complete $c1 level to get to the {{c2}} level."
temp = Template(temp)
out = temp.substitute({'c1':'foundation', 'c2':'diploma'})
print(out)
```
A student needs to complete $c1 level to get to the diploma level.

A student needs to complete foundation level to get to the
{{c2}} level.
A student needs to complete foundation level to get to the diploma level.

``` KeyError: 'c2' ```

Consider a `<span>` element and the styling given to it in `<style>` tag using element selector in the HTML file below.
```html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Span</title>
<style>
span{
color: blue;
Background-color: lime;
}
</style>
</head>
<body>
<span id="my_span">MAD-I is a Diploma level course.</span>
</body>
</html>
```
What will be the final style applied to `<span>` tag if an additional style is added via the ID selector given below?
```css
#my_span{
width: 1200px;
Background-color: lightpink;
}
```
```css color: blue; Background-color: lightpink; ```

```css color: blue; width: 1200px; Background-color: lime; ```

```css color: blue; width: 1200px; Background-color: lightpink; ```

```css width: 1200px; Background-color: lightpink; ```
Consider the following HTML document. ```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
p {
background-color: yellow;
color: red;
display: inline-block;
}
#id {
border: 2px solid purple;
color:blue ;
}
.class {
background-color: aqua;
color: red;
}
</style>
</head>
<body>
<p class="class" id="id">HTML</p>
<p class="class" >HTML</p>
<p>HTML</p>
</body>
</html>
```
How will the browser render above HTML file?
The image displays three rectangular boxes stacked vertically, each containing the text "HTML". 1. **Top box:** Cyan background, blue text, purple border. 2. **Middle box:** Cyan background, red text, no visible border. 3. **Bottom box:** Yellow background, red text, no visible border.

The image displays three rectangular boxes, each containing the text "HTML". 1. **Left Box:** A light blue rectangle with the text "HTML" in red. The text appears slightly blurred. 2. **Middle Box:** A light blue rectangle with a purple border. The text "HTML" is in blue. 3. **Right Box:** A yellow rectangle with the text "HTML" in red, with a gradient effect making it appear orange/yellow in some parts. The text also appears slightly blurred.

The image displays three rectangular blocks, each containing the text "HTML". 1. **Left Block:** A cyan rectangle with a purple border. The text "HTML" is in blue. 2. **Middle Block:** A cyan rectangle with no border. The text "HTML" is in red. 3. **Right Block:** A yellow rectangle with no border. The text "HTML" is in red.

The image displays three rectangular blocks, each containing the text "HTML". 1. **Left block:** A cyan-colored rectangle with the text "HTML" in red. The text has a slight shadow effect. 2. **Middle block:** A yellow-colored rectangle with the text "HTML" in red. The text also has a slight shadow effect. 3. **Right block:** A cyan-colored rectangle with a purple border. The text "HTML" is in blue and has a slight shadow effect.
Consider the following Python code snippet. app.py
```python
from jinja2 import Template
import sys
input_list = sys.argv
Name, profession = input_list[1], input_list[2]
if input_list[1]=="Meera":
profession="Data Analyst"
else:
pass
template = """
<!DOCTYPE html>
<html>
<div>
{{Name}}
{{Profession}}
</div>
</html>
"""
t = Template(template)
print(t.render(Name = name, Profession = profession))
```
Map the commands in column A with the correct rendered output in the browser in column B.
| Column A | Column B |
|---|---|
| a) python app.py Kartik Doctor | 1) Meera Data Analyst |
| b) python app.py Meera Scientist | 2) Ajay Singer |
| c) python app.py Ajay Singer | 3) Kartik Web |
| d) python app.py Kartik Web Developer | 4) Kartik Doctor |
| | 5) Kartik Web Developer |
Consider the following Python code snippet: ```python
from pyhtml import *
code = html(
head(style('div{border:2px solid black;margin: 2px; width: 200px;}')),
body(==== BODY CONTENT ====)
)
print(code.render())
```
If the text "==== BODY CONTENT ====" is replaced by each option in column A and rendered, which of the following mapping between column A and Column B is correct?
| Column A | Column B |
|---|---|
| a) div('Hello'),div(),div() | 1) Hello (three overlapping rectangles around "Hello") |
| b) div(),div(div('Hello')) | 2) Hello (one rectangle around "Hello", with three horizontal lines below it) |
| c) div(div(div('Hello'))) | 3) Hello (three concentric rectangles around "Hello") |
| d) div(div('Hello'),div()) | 4) Hello (two overlapping rectangles around "Hello") |
Consider the following HTML document and select the DOM structure that
correctly represents the HTML document.
```html
<!DOCTYPE html>
<head>
<title>My title</title>
</head>
<body>
<h1>A heading</h1>
<a href="link">Link text</a>
</body>
</html>
```
This is a diagram representing a hierarchical structure, likely a Document Object Model (DOM) tree for an HTML document.
The diagram consists of several rounded rectangular nodes connected by lines, indicating parent-child relationships.
- **Document** (pink node) is at the top.
- It connects to **html** (purple node).
- **html** connects to two blue nodes: **<Head>** and **<body>**.
- **<Head>** connects to **<title>** (yellow node).
- **<title>** connects to **"My title"** (brown node).
- **<body>** connects to **<h1>** (yellow node).
- **<h1>** connects to **'A heading'** (brown node).
- **<h1>** also connects to **<a>** (yellow node).
- **<a>** connects to **"Link text"** (brown node).
- **<a>** also connects to **Attr=href** (purple node) via a horizontal line.
This is a tree diagram representing the structure of an HTML document. The root node is a pink rectangle labeled "Document". An arrow points from "Document" to a purple rounded rectangle labeled "html". From "html", two arrows point to: 1. A blue rounded rectangle labeled "<Head>" 2. A blue rounded rectangle labeled "<body>" From "<Head>", an arrow points to a yellow rounded rectangle labeled "<title>". From "<title>", an arrow points to a beige rounded rectangle labeled "\"My title\"". From "<body>", two arrows point to: 1. A yellow rounded rectangle labeled "<h1>" 2. A yellow rounded rectangle labeled "<a>" From "<h1>", an arrow points to a beige rounded rectangle labeled "\"A heading\"". From "<a>", two arrows point to: 1. A beige rounded rectangle labeled "\"Link text\"" 2. A light purple rounded rectangle labeled "Attr-href"

This is a diagram representing a hierarchical structure, likely an HTML DOM tree. The diagram shows the following elements and their relationships: - A pink rounded rectangle labeled "Document" at the top. - A black line connects "Document" to a purple rounded rectangle labeled "html". - A black line connects "html" to a blue rounded rectangle labeled "<body>". - A black line connects "<body>" to a yellow rounded rectangle labeled "<h1>". - A black line connects "<h1>" to a yellow rounded rectangle labeled ""A heading"". - A black line connects "<h1>" to another yellow rounded rectangle labeled "<a>". - A black line connects "<a>" to a yellow rounded rectangle labeled ""Link text"". - A black line connects "<a>" to a light purple rounded rectangle labeled "Attr=href".

This is a diagram representing a Document Object Model (DOM) tree. The root node is "Document" (pink rectangle). An arrow points from "Document" to "html" (purple rounded rectangle). From "html", there are three branches: 1. An arrow points to "<title>" (yellow rounded rectangle). An arrow points from "<title>" to "\"My title\"" (brown rounded rectangle). 2. An arrow points to "<h1>" (yellow rounded rectangle). An arrow points from "<h1>" to "\"A heading\"" (brown rounded rectangle). 3. An arrow points to "<a>" (yellow rounded rectangle). From "<a>", there are two branches: a. An arrow points to "\"Link text\"" (brown rounded rectangle). b. An arrow points to "Attr=href" (purple rounded rectangle).
Consider the following Python code snippet. ```python
from jinja2 import Template
temp = """
{% for vid, members in interfaces|groupby(attribute='lan') %}
Interfaces in lan {{ vid }}: {{ members|map(attribute='name')
| join(', ') }}
{% endfor %}
"""
interfaces = [
{"name":"Ethernet1","lan":50},
{"name":"Ethernet2","lan":40},
{"name":"Ethernet3","lan":50},
{"name":"Ethernet4","lan":60}
]
output = Template(temp)
print(output.render(interfaces=interfaces))
```
What will be the output of above python code on the terminal.
Interfaces in lan 50: Ethernet1 Interfaces in lan 40: Ethernet2 Interfaces in lan 50: Ethernet3 Interfaces in lan 60: Ethernet4

Interfaces in lan 40: Ethernet1, Ethernet3 Interfaces in lan 50: Ethernet2 Interfaces in lan 60: Ethernet4

Interfaces in lan 40: Ethernet2 Interfaces in lan 50: Ethernet1, Ethernet4 Interfaces in lan 60: Ethernet3

Interfaces in lan 40: Ethernet2 Interfaces in lan 50: Ethernet1, Ethernet3 Interfaces in lan 60: Ethernet4
A Flask application and its absolute path is given below. Based on the above data, answer the given subquestions.
If the application is run locally on http://127.0.0.1:5000 using the command python app.py, what will be rendered by the browser for URL http://127.0.0.1:5000/home?

static url path: C:\home\mad_1\static static folder: /static

static url path: /static static folder: C:\home\mad_1\static

static url path: /stable static folder: C:\home\mad_1\stable

static url path: /static static folder: C:\home\mad_1\stable

If the application is run locally on http://127.0.0.1:5000 using the command python app.py stable, what will be rendered by the browser for URL http://127.0.0.1:5000/home?

static url path: /static static folder: C:\home\mad_1\static

static url path: /stable static folder: C:\home\mad_1\stable

static url path: C:\home\mad_1\stable static folder: /stable

static url path: /stable static folder: C:\home\mad_1\static
Auto-generated summary from the source site. Handy as a checklist; the lessons above explain each idea from scratch.