Quiz Space

MAD 1 End Term: 22 December 2024 (September 2024 term)

Question 1

+2 marksOne correct option

Consider the following models Library and Book corresponding to tables library and book in SQLite database.

python
class Library(db.Model):
id = db.Column(db.Integer(), primary_key = True)
name = db.Column(db.String(), unique = True)
class Book(db.Model):
id = db.Column(db.Integer(), primary_key = True)
name = db.Column(db.String(), unique = True)
library = db.Column(db.Integer(), unique = True, db.ForeignKey("section.id"))

Based on the model schemas, what relationship do the classes Library and Book share?

  1. A

    Many-to-Many

  2. B

    One-to-Many

  3. C

    One-to-One

  4. D

    The tables are not at all related

Question 2

+2 marksOne correct option

Consider the following python code snippet “app.py”, the HTML files, “base.html” and “home.html” residing in “templates” folder.

app.py

python
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def home():
return render_template('home.html')
app.run(debug=True)

home.html

html
{% extends "base.html" %}
{% block content %}
<h3>This is from home.html</h3>
{% endblock %}

base.html

html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
</head>
<body>
<h3 style="color: blue;"> This is from base.html </h3>
{% block content %}
{% endblock %}
</body>
</html>

What will be the rendered output for base URL if flask app is running locally on http://localhost:5000

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

Question 3

+2 marksOne correct option

Consider the following Python code snippet.

python
from string import Template
sentence = Template("A $var1 fox $var2 over the $var3 dog")
output = sentence.safe_substitute(word_dict)
print(output)

Which of the following options correctly represent(s) the dictionary word_dict, such that the code does not throw any error when run in the terminal?

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

29 more questions in this paper

Sign in with Google — it is free — to see every question with its answer and explanation, practise it in learning mode, or take it as a timed mock test.

More on the MAD 1 End Term 22 Dec 2024 paper

The IIT Madras BS Modern Application Development I (MAD 1) End Term paper sat on 22 Dec 2024, in the September 2024 term: 32 questions for 100 marks in 180 minutes. The first 3 questions are below. Sign in with Google — it is free — to see the whole paper with its answers and explanations, in learning mode or as a timed mock test.

FeatureMAD 1 End Term 22 Dec 2024 at a glance
TermSeptember 2024 term
SubjectModern Application Development I
Course codeBSCS2003
Questions32
Marks100
Duration180 min
MCQ23
MSQ7
Numerical2
Official paperIIT M FOUNDATION DIPLOMA FN EXAM QDF1 22 Dec 2024
Negative markingNo negative marking.
Updated

Same End Term, other subjects

More MAD 1