CBSE Guess > Papers > Important Questions > Class XII > 2012 > Computer Science > Computer Science Vinay Kumar Srivastava Computer Science- CBSE CLASS XII Q 2 . Answer the following questions:- a) A variable amount has a value 25365. Write the statement to display the value in a Label control named lblAmount. For - 1 Marks Ans: lblAmount.setText(“ ”+amount); b) What is the purpose of break statement in switch…case statement? For - 1 Marks Ans: In a switch statement, when a match is found, the statement sequence associated with that case is executed until a break statement or end of switch is reached so if break statement is missing the statement sequence is executed from the case which was found true to downward until the end of the switch statement is reached no matter whether the statement sequence falls under any other case or default clause. c) Differentiate between <A> and <B> tag of HTML. For - 1 Marks Ans: <A> tag is known as Anchor tag and used for Hyper linking and <B> tag is used for converting the sentence/paragraph in Bold face. d) Write any two features of XML. For - 1 Marks Ans: Features of XML (any two) e) What will be the output after executing the following code? For - 2 Marks Ans: 57 f) Write a method in Java that takes an year (4-digit) and return true if year is leap, otherwise false. For - 2 Marks Ans: boolean funLeap(int year) g) What are the uses of the following tags:- For - 2 Marks Ans: <HTML> - Identifies that the document is a HTML document. Q 3 . a) If a database “Library” exists. Write the command to start working in this database. For - 1 Marks Ans: USE Library; b) While creating a table “MobDet”, Kavita forgot to set primary key for the table. Write the statement to set the column MobileNo as the primary key of the table For - 1 Marks Ans: ALTER TABLE MobDet ADD PRIMARY KEY (MobileNo); Prepared By: Mr. Pradumna Singh |