Quiz Space

MAD 2 Quiz 2: 1 December 2024 (September 2024 term)

Question 1

+3 marksOne correct option

Consider the below JavaScript program.

javascript
function main() {
var count = 0;
function increment(num = count++) {
count += num;
}
increment();
increment(2);
increment();
console.log(count);
}
main();

What will be the output of the above program?

  1. A

    3

  2. B

    4

  3. C

    7

  4. D

    8

  5. E

    6

Question 2

+3 marksOne correct option

Consider the below Vue component.

html
<template>
<div>
<p>{{ message }}</p>
<button @click="updateMessage">Change Message</button>
</div>
</template>
<script>
export default {
data() {
return {
message: 'Hello'
};
},
methods: {
updateMessage() {
this.message = this.message === 'Hello' ? 'World' : 'Hello';
}
}
};
</script>

What will be displayed in the <p> element, after the button with text “Change Message” is clicked?

  1. A

    Empty

  2. B

    Error

  3. C

    undefined

  4. D

    World

  5. E

    Hello

Question 3

+3 marksOne correct option

Consider the below JavaScript program.

javascript
async function asyncFunc() {
try {
const result1 = await Promise.resolve('Start');
console.log(result1);
const result2 = await new Promise((resolve, reject) => {
setTimeout(() => reject('Error'), 100);
});
console.log(result2);
} catch (error) {
console.log('Caught:', error);
}
return 'End';
}
asyncFunc().then(result => console.log(result));

What will be the output of the program?

  1. A

    Start, Caught: Error, End

  2. B

    Start, End, Caught: Error

  3. C

    Caught: Error, Start, End

  4. D

    Start, Error, End

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 1 Dec 2024 paper

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

Same Quiz 2, other subjects

More MAD 2