Quiz Space

Modern Application Development II · Quiz 1 · 25 Feb 2024 · January 2024 term

Question 6: Consider the following Vue application with markup index.…

Question 6

+4.5 marksOne correct option

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

index.html

html
<body>
<div id="app"></div>
<script
src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script src="./app.js"></script>
</body>

app.js

javascript
new Vue({
el: '#app',
template: `<div>
<div id="holiday">{{isHoliday?"Holiday":"Not Holiday"}}</div>
<button @click="increeseCount">Increese Count</button>
</div>`,
data: {
count: 1,
isHoliday: false,
},
watch: {
count() {
if (this.count % 5 == 0) {
this.isHoliday = true
}
},
},
methods: {
increeseCount() {
this.count += 6
},
},
})

Suppose the application is running on “http://localhost:8080” if the user clicks on button “Increese Count” 5 times. What will be rendered inside the div with id “holiday”?

  1. A

    Holiday

  2. B

    Not Holiday

  3. C

    true

  4. D

    false

Show answer

Correct answer

  • A

    Holiday

Question 6 of 16 in the IIT Madras BS Modern Application Development II (MAD 2) Quiz 1 paper sat on 25 Feb 2024, in the January 2024 term (IIT M DIPLOMA AN2 EXAM QDD2 25 Feb 2024). It carries 4.5 marks.

More questions from this paper

  1. Q1Consider the following JavaScript code. What will be logged on to the console once the code is executed?
  2. Q2Consider the following JavaScript code. What will be logged on to the console once the code is executed?
  3. Q3Consider the following JavaScript code. What will be logged on to the console once the code is executed?
  4. Q4Consider the following JavaScript code. What will be logged on to the console once the code is executed?
  5. Q5Consider the following Vue application with markup index.html and JavaScript app.js index.html app.js Suppose the appli…
  6. Q7Consider the following JavaScript code. What will be logged on to the console once the code is executed?
  7. Q8Consider the following JavaScript code. What will be logged on to the console once the code is executed?
  8. Q9Which of the following statement(s) is/are true regarding JavaScript language?
  9. Q10Consider the below JavaScript program. What will be the output of the above program, if executed?
  10. Q11Which of the following is/are example(s) of application state (i.e., system as seen by an individual user)?
  11. Q12Which of the following statement(s) is/are true?
  12. Q13Which of the following is a valid function definition to return the sum of 2 numbers passed as parameter?
  13. Q14Consider the below JavaScript program. What will be the output of the above program, if executed?
  14. Q15Which of the following is not a valid Vue directive?
  15. Q16Consider the below javascript program. What will be the output of the above program, if executed?