Quiz Space

MAD 2 Quiz 2: 4 August 2024 (May 2024 term)

Question 1

+2 marksOne correct option

Consider the below JavaScript program.

javascript
const first = "Hello 3";
const obj1 = {
first: "Hello 1",
secondFunc: function () {
console.log(this.first);
}
}
const obj2 = {
first: "Hello 2",
secondFunc: function () {
console.log(this.first);
this.secondFunc();
}
}
obj1.secondFunc.apply(obj2, [2, 5, 9]);

What will be the output of the above program, if executed?

  1. A

    Hello 1

  2. B

    Hello 1
    Hello 2

  3. C

    Hello 2

  4. D

    The program will result in an infinite loop

Question 2

+2 marksOne correct option

Consider the following Vue application with markup “index.html” and JavaScript file “app.js”.

index.html:

html
<div id = "app">
<my-comp>
<template #header>
This is header content
</template>
<template #footer>
This is footer content
</template>
<p> This is some content </p>
</my-comp>
</div>
<script src = "app.js"> </script>

app.js:

javascript
Vue.component("myComp", {
template : `<div>
<p>
<slot></slot>
</p>
<p>
<slot name="footer"></slot>
</p>
</div>
`,
})
const app = new Vue({
el : "#app",
})

Suppose you open the “index.html” file in a browser. What will be rendered by the browser?

  1. A

    This is header content
    This is footer content
    This is some content

  2. B

    This is footer content
    This is some content

  3. C

    This is some content

  4. D

    This is some content
    This is header content

  5. E

    This is some content
    This is footer content

Question 3

+3 marksOne correct option

Consider the following application with markup index.html and script app.js.

index.html:

html
<body>
<div id="app">
<router-view></router-view>
</div>
</body>

app.js:

javascript
const Header = {
template: `<div>This is header <router-view /> </div>`,
}
const Error = {
template: '<div> 404 Page not found</div>',
}
const Profile = {
template: `<div> Welcome to profile page</div>`,
}
const routes = [
{
path: '/',
component: Header,
children: [
{ path: 'profile', component: Profile },
{ path: '*', component: Error },
],
},
]
const router = new VueRouter({
routes,
})
new Vue({
el: '#app',
router,
})

Suppose the application is running on http://127.0.0.1:8080. What will be rendered in the browser?

  1. A

    This is header
    404 Page not found

  2. B

    404 Page not found
    This is header

  3. C

    Welcome to profile page
    This is header

  4. D

    This is header
    Welcome to profile page

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 4 Aug 2024 paper

The IIT Madras BS Modern Application Development II (MAD 2) Quiz 2 paper sat on 4 Aug 2024, in the May 2024 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 4 Aug 2024 at a glance
TermMay 2024 term
SubjectModern Application Development II
Course codeBSCS2006
Questions16
Marks50
Duration120 min
MCQ13
MSQ3
Official paperIIT M DIPLOMA AN EXAM QDD2 4 Aug 2024
Negative markingNo negative marking.
Updated

Same Quiz 2, other subjects

More MAD 2