Cbse Class 12 Informatics Practices Question Paper 2012
Cbse Class 12 Informatics Practices Question Paper 2012
Informatics Practices
Previous Year Question Paper 2012
Series: SMA Code no. 90
INFORMATICS PRACTICES
2.(a) While making a Form in Netbeans, Mr. Harihar Jha wants to display a
list of countries to allow the users to select their own country. Suggest him to
choose most appropriate control out of ListBox and ComboBox. 1 Mark
Ans: Combo Box
(b) What is the purpose of break keyword while using Switch Case
Statement? Illustrate with the help of an example. 1 Mark
Ans: Break keyword is used to prevent the fall through problem by terminating
the switch statement after executing the correct case.
Example:
switch(city)
{
case “Delhi” :
System.out.println(“He can visit Qutub Minar”);
break;
case “Mumbai” :
System.out.println(“He can visit Gateway Of India”);
4.(a) What message will be displayed after the execution of the following
code? 2 Marks
int Age=64,Relaxation=4;
5 7 9 11
2 4 6 8 10
(i) To display names of the items whose name starts with ‘C’ in ascending
order of Price. 1 Mark
Ans: SELECT Item FROM SHOPPE WHERE Item LIKE 'C%' ORDER BY
Price;
(ii) To display code, Item name and City of the products whose quantity is
less than 100. 1 Mark
Ans: SELECT Code, Item, City FROM SHOPPE WHERE Qty<100;
(iii) To count distinct Company from the table. 1 Mark
Ans: SELECT COUNT(DISTINCT(Company)) FROM SHOPPE;
(iv) To insert a new row in the table Shoppe ‘110’,’Pizza’,’Papa Jones’, 120,
”Kolkata”, 50.0 1 Mark
Ans: INSERT INTO SHOPPE VALUES (110, 'Pizza', ‘Papa Jones’, 120,
'Kolkata', 50.0);
(v) Select Item from Shoppe where Item IN(“Jam”,”Coffee”) 1 Mark
Ans: Item
6.(a) Write a MySql command to create the Table STOCK including its
Constraints. 2 Marks
Table : STOCK
Name Varchar 20
Company Varchar 20
Table : BRAND
ICode Brand
101 Sony
202 HP
303 LG
404 IFB
Ans: Controls
1. TextBox
2. Radio Button
3. Combo Box
4. CheckBox