Previous Year CBSE Board Question Paper 2022-2017
CLASS XII WEB APPLICATION (SUBJECT CODE -803)
Answer Key of CBSE Previous Year Questions 2020 (Old) Examination
1 – Mark Questions
(d) ? :
Answer: (a) %
Answer: (d) Math.random()
var name = [“Red”, “Blue”, “Yellow”, “Green”];
Answer: (b) Green
(a) be visible to the entire compound ‘‘if’’ statement
(b) not be visible to the entire compound ‘‘if’’ statement
(c) be visible to the entire function
(d) not be visible to the entire function
Answer: (a) be visible to the entire compound ‘‘if’’ statement
5. To use an object’s methods or properties, we write the object’s name, ______ and then the method/property name.
(a) a dot[.]
(b) an asterisk[*]
(c) an ampersand[&]
(d) a pound[#]
Answer: (a) a dot [.]
2 – Marks Questions
5. Differentiate between Property and Method with example.
Answer: Differentiate between Property and Method:
- Properties define the characteristics of an object. Examples are color, length, name,
height, width etc.
- Methods are the actions that the object can perform or that can be performed on the object. Examples are alert, confirm, write, open, close etc.
6. Explain Fall through with respect to switch statement with the help of an example.
Answer: Fall through is a condition in which if one case is true and does not contain the break statement, the next case is also executed.
var num = 1;
case 1 : document.write(“One” + “<br>”);
case 2 : document.write(“Two” + “<br>”);
case 3: document.write(“Three” + “<br>”);
default: document.write(“Invalid” + “<br>”);
3 – Marks Questions
This code should be placed under the <HEAD> </HEAD> tag in HTML.
8. What will be the final value of A and B on executing the following code:
A = 43
B = A+1
Answer: Final Value of A is 44 and B is 45.
5 – Marks Questions
9. Write a function that displays a prompt box which accepts a name and displays a greet message ‘‘hello <name>, Have a good day’’ when the user enters a name in a <p> (paragraph) which has an id ‘‘demo’’. The function header is as below:
<p><strong>Click the button to demonstrate the prompt box.</strong></p>
<button onclick=”myFunction()”>try it</button>
person=prompt(“please enter your name : “);
if(person != null)
x = (“hello” + person + “!how are u today?”);
document.getElementById(“demo”).innerHTML = x;
(a) To store date and time in a variable and then display date and time on the webpage.
(b) (i) To store ‘‘Genius is one percent inspiration, 99% perspiration’’ in a variable.
(ii) To search ‘‘percent’’ in the string ‘‘Genius is one percent inspiration, 99% perspiration’’ and display it on the webpage.
(a) var datetime = new Date();
(b) (i) var str = “Genius is one percent inspiration, 99% perspiration”;
(ii) document.write(str.match(“percent”) + “<br>”);