Quiz Space

Modern Application Development II · Quiz 2 · 3 Aug 2025 · May 2025 term

Question 11: Filename: app.js Suppose the application is running on "…

Question 11

+3 marksOne or more correct options

Filename: app.js

javascript
const inventory = {
101: {product: "Canvas", quantity: 15, warehouse: 3},
102: {product: "Brushes", quantity: 8, warehouse: 2}
}
const errorPage = {
template: `<h1>Item not found in inventory!</h1>`
}
const productDetails = {
template: `<h1>{{item.product}} - {{item.quantity}} units stored in
{{item.warehouse}} locations.</h1>`,
data() {
return {item: inventory[this.$route.params.productId]}
},
watch: {
'$route'(to, from) {
this.item = inventory[to.params.productId]
}
}
}
const router = new VueRouter({
mode: 'history',
routes: [
{ path: '/inventory/:productId', component: productDetails },
{ path: '*', component: errorPage },
],
})
new Vue({
el: '#app',
template: '<div><router-view /></div>',
router,
})

Suppose the application is running on "http://localhost:3000", select the correct option(s)?

Select all that apply.

  1. A
  2. B
  3. C
  4. D
  5. E
Show answer

Correct answers

  • A
  • C
  • E

Question 11 of 16 in the IIT Madras BS Modern Application Development II (MAD 2) Quiz 2 paper sat on 3 Aug 2025, in the May 2025 term (IIT M DIPLOMA AN EXAM QDD2 03 Aug 2025). It carries 3 marks.

More questions from this paper

  1. Q1Suppose a client wants to make a POST request using the Fetch API to a public endpoint at /api/submit, which includes s…
  2. Q2Which of the following statements are true?
  3. Q3Which of the following statement(s) about Web Storage APIs is/are correct?
  4. Q4Which of the following statement(s) is/are true regarding Single Page Applications (SPA) and Progressive Web Apps (PWA)?
  5. Q5Consider the following code snippet. What will be logged to the console?
  6. Q6The following code is using Vue 2 and Vue router 3 running on http://127.0.0.1:5500. Filename: index.html Filename: rou…
  7. Q7Consider the following Vue 2 component defined using the CDN version: Filename: index.html Filename: app.js What will b…
  8. Q8Consider the following JavaScript program: What will be the output of the above program when executed?
  9. Q9Consider the following Vue application with markup "index.html" and JavaScript file "app.js". Filename: index.html File…
  10. Q10Consider the following Vue 2 code with Vuex 3 used via CDN, assume the Vuex store is correctly injected into the Vue in…
  11. Q12The following code is using Vue 2 and Vue router 3 running on http://127.0.0.1:5500. Filename: index.html Filename: rou…
  12. Q13Consider the following Vue application with markup "index.html" and JavaScript file "app.js". Filename: index.html File…
  13. Q14Consider the following Vuex store setup for a user management system: What will happen when the following sequence of o…
  14. Q15You are given the following HTML and JavaScript code that uses Vue 2 via CDN along with Vue Router. Read the code caref…
  15. Q16Suppose the button is clicked multiple times quickly, the message area flickers unexpectedly. How can you improve the c…