Quiz Space

September 2022 term · Modern Application Development I · BSCS2003

MAD 1 Quiz 1: 16 October 2022 (September 2022 term)

The IIT Madras BS Modern Application Development I (MAD 1) Quiz 1 paper sat on 16 Oct 2022, in the September 2022 term: 17 questions for 50 marks in 120 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.

Questions
17
Marks
50
Duration
120 min
MCQ
13
MSQ
3
Numerical
1

Updated

Official paper: IIT M QUIZ 1 FOUNDATION DAD DIPLOMA QPD2 16 Oct 2022 · No negative marking.

Question 1

+2 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • C

Question 2

+2 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • B

Question 3

+2 marksOne correct option

Consider the following Python code snippet.

python
from jinja2 import Template
temp = """{% for num in seq|reject("even") %}
{{ num+2 }}
{% endfor %}
"""
seq = [6,5,71,13,30,22]
output = Template(temp)
print(output.render(seq = seq))

What will be the output if the given code is executed?

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • C

Question 4

+3 marksOne correct option

Consider the following Python code snippet.

(Concept: Python string and Jinja2 templates)

python
from string import Template as T1
from jinja2 import Template as T2
info = {'girl1': 'Mary', 'girl2': 'Samantha',
'girl3': 'girl2', 'girl4': 'girl1',
'city1':'Moscow', 'city2':'city1'}
t1 = T1("{{$girl3}} and {{$girl4}} arrived at the {{$city2}} station early
and waited for the bus.")
out1 = t1.substitute(info)
out2 = T2(out1)
print(out2.render(info))

What will be the output on the terminal?

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • B

Question 5

+3 marksOne correct option

Consider the code snippets given below.
(Concept: HTML and CSS)

File 1: index.html:

html
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h3>The CSS Box Model</h3>
<div class="my_border box">
<h3 class="title">Border</h3>
<div class="my_padding box">
<h3 class="title">Padding</h3>
<div class="my_content box">
<h3 class="title">Content</h3>
<div>
<div>
<div>
</body>

File 2: style.css:

css
div.my_border
{background-color: purple;
border: 2px dotted grey;
height: 130px;
width: 130px;}
div.my_padding
{background-color: lightblue;
height: 80px;
width: 80px;}
div.my_content
{background-color: yellow;
height: 40px;
width: 45px; }
.title
{text-align: left;
font-size: 10px;
font-style: italic;}
.box
{margin: 10px 20px;
padding: 0px;}

What will be rendered by the browser, when the above HTML file is loaded?

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • A

Question 6

+3 marksOne correct option

Consider the following Python code given below.

(Concept: Flask and concepts of HTTP methods)

python
from flask import Flask, request, url_for
app = Flask(__name__)
@app.route('/dashboard')
def dashboard():
return 'This is the dashboard'
@app.route('/user/<username>')
def user(username):
return f'This is {username} profile'
@app.route('/login', methods=['GET', 'POST'])
def login():
if request.method == 'POST':
return(url_for('user', username='your_name'))
else:
return (url_for('dashboard'))
if __name__ == '__main__':
app.run(debug=True)

If the above flask application is running on URL “http://127.0.0.1:5000”, which of the following is the correct output if a user visits the URL “http://127.0.0.1:5000/login”, using a browser?

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • B

Question 7

+3 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • A

Question 8

+3 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • D

Question 9

+3 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • B

Question 10

+3 marksOne correct option

Consider the below HTML and CSS styling.

html
<html>
<head>
<style>
h3 {
color: green;
}
.content {
color: red;
}
</style>
</head>
<body>
<h3 class = "content">This is the main Content</h3>
<button onclick = "remove_class"> Click Me </button>
</body>
</html>

Assuming clicking the button with the text “Click Me” removes the class “content” from the “h3” element, what will be the text colour of the text placed inside the “h3” element, before and after clicking the button with the text “Click Me” (Assume a normal browser is used which shows black text on white background)?

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • B

Question 11

+4.5 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • C

Question 12

+4.5 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • C

Question 13

+2 marksOne or more correct options

Select all that apply.

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answers

  • C
  • D

Question 14

+4.5 marksOne or more correct options

Which of the following option(s) will generate the HTML code equivalent to the below HTML code?

[Concepts covered: Programmatic HTML generation]

html
<!DOCTYPE html>
<html>
<head>
<title>My title</title>
</head>
<body>
<div>
<div>
<h2>inside title</h2>
</div>
<p>some text in a paragraph</p>
</div>
</body>
</html>

Select all that apply.

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answers

  • A
  • B

Question 15

+3 marksNumerical answer
Show answer

Correct answer: 6

Question 16

+2.5 marksOne or more correct options

Based on the above data, answer the given subquestions.

Select all that apply.

  1. A
  2. B
  3. C
  4. D
  5. E
Show answer

Correct answers

  • B
  • C
  • E

Question 17

+2 marksOne correct option

Based on the above data, answer the given subquestions.

What S_Id(s) is/are returned by the following SQL query for the given instance of the relational tables?

sql
select R.S_Id from Student S join Result R on S.S_Id=R.S_id join
Course C on R.C_Id=C.C_Id where R.Marks>70 and S.City='Chennai' and
C.Course_name='MAD1'
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • C