Quiz Space

MAD 2 Quiz 2: 3 December 2023 (September 2023 term)

Question 1

+3 marksOne correct option

Consider the following JavaScript code.

javascript
function promiseBuilder(t) {
return new Promise((res, rej) => {
setTimeout(() => {
const count = Math.floor(t / 1000)
if (count > 3) {
res(count)
} else {
rej(count * 2)
}
}, t)
})
}
async function getData() {
let data1 = null,
data2 = null
try {
data1 = await promiseBuilder(5000)
} catch (e) {
data1 = 30
}
try {
data2 = await promiseBuilder(2000)
} catch (e) {
data2 = 40
}
return data1 + data2
}
getData().then(
(res) => {
console.log(8 * res)
},
(err) => {
console.log(6 * err)
}
)

What will be logged on to the console?

  1. A

    56

  2. B

    272

  3. C

    360

  4. D

    560

Question 2

+3 marksOne correct option

Consider the Vue application with markup index.html and JavaScript app.js

index.html

html
<body>
<div id="app"></div>
</body>

app.js

javascript
const NavBar = {
template: `<ul>
<li> Home </li>
<slot><li>Bowling Average</li></slot>
</ul>`,
}
const Batsman = {
template: `<NavBar><li>Batting Average</li><li>Strike
Rate</li></NavBar>`,
components: {
NavBar,
},
}
new Vue({
el: '#app',
template: `<Batsman />`,
components: {
Batsman,
},
})

Suppose the application is running on “http://localhost:8080” . What will be rendered by the browser?

  1. A

    ● Home
    ● Bowling Average

  2. B

    ● Home
    ● Bowling Average
    ● Batting Average

  3. C

    ● Home
    ● Batting Average
    ● Strike Rate

  4. D

    ● Bowling Average
    ● Batting Average

Question 3

+3 marksOne correct option

Consider the following Vue app with markup index.html and JavaScript app.js.

index.html

html
<body>
<div id="app"></div>
</body>

app.js

javascript
const Dashboard = {
template: `<div> This is dashboard for {{user.name}} </div>`,
props: ['id'],
data() {
return {
users: [
{ id: 1, name: 'User1' },
{ id: 2, name: 'User2' },
{ id: 3, name: 'User3' },
],
}
},
computed: {
user() {
const user = this.users.find((user) => user.id == this.id)
if (user) {
return user
} else {
return this.users[2]
}
},
},
}
const router = new VueRouter({
routes: [{ path: '/dashboard/:id', component: Dashboard, props:
true }],
})
new Vue({
el: '#app',
template: `<router-view />`,
router,
})

Suppose the application is running on “http://localhost:8080” . What will be rendered inside the router-view component of root component for the URL “http://127.0.0.1:8080/#/dashboard/8” ?

  1. A

    This is dashboard for User1

  2. B

    This is dashboard for User2

  3. C

    This is dashboard for User3

  4. D

    None of these

13 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 2 Quiz 2 3 Dec 2023 paper

The IIT Madras BS Modern Application Development II (MAD 2) Quiz 2 paper sat on 3 Dec 2023, in the September 2023 term: 16 questions for 50 marks in 120 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 2 Quiz 2 3 Dec 2023 at a glance
TermSeptember 2023 term
SubjectModern Application Development II
Course codeBSCS2006
Questions16
Marks50
Duration120 min
MCQ13
MSQ3
Official paperIIT M DIPLOMA AN2 EXAM QDD2 03 Dec 2023
Negative markingNo negative marking.
Updated

Same Quiz 2, other subjects

More MAD 2