Time Allowed: 3 Hours, Maximum Marks: 70: CBSE Class - XII Informatics Practices
Time Allowed: 3 Hours, Maximum Marks: 70: CBSE Class - XII Informatics Practices
1 (a) The ‘Chalchitra’ theatre has a computer network. The network is in one building.
(ii) Name one communication channel that can be used for fast communication
between workstations of the network. (2)
Ans. (i).LAN
Ans. 1. Denial of service attack: It is an attempt to make one or more network resources
unavailable to their legitimate users.
Ans. Unicode encoding standard provides the basis for processing, storage and interchange
of text data in any language in all modern software and information technology protocols.
IP address 122..219
(e) Identify the topology shown below. Write 2 advantages of this topology. (2)
Ans.
1. Easy to install
2 (a) While working in Netbeans, Ms. Sonia has designed a login page where she wants
to display “Welcome” or “Try again” message depending on the password entered by
the user in text field named ‘jTexField1’. If password entered is “India”, ‘Welcome’
message should be displayed otherwise ‘Try again’ message should be displayed. Help
her in choosing more appropriate statement out of 'If statement' and 'Switch
statement'. Give reason for your choice. (1)
(b) Write Java code to assign the value 10 to variable x and store its square value in
another variable y. (1)
Ans. x=10;
y=x*x;
(c) Deepti works as a programmer in a travel company. She has developed the following
code to display travel detail according to user’s choice. Help her in rewriting the same
code using SWITCH CASE:
else if(choice==2)
else if(choice==3)
else
Ans. switch(choice)
case 1:
break;
case 2:
break;
case 3:
break;
default:
(d) Shambhavi has to design two web pages with following specifications:
Suggest her suitable tag(s) and attribute(s) for the above specifications. (2)
<STUDENT>...</STUDENT>
<Student>....</Student>
do
JOptionPane.showMessageDialog(null,value1+value2);
value1=value1+2;
value2=value2-2;
Ans. 4 times.
ID Salary
101 43000
102 NULL
104 56000
107 NULL
To select tuples with some salary ,Siddharth has written the following erroneous SQL
statement:
Ans.(a) SELECT ID, Salary FROM empsalary WHERE Salary is NOT NULL;
Employee
Name Location
Gurpreet Mumbai
Jatinder Chennai
Deepa Mumbai
Harsh Chennai
Simi New Delhi
Anita Bengaluru
(c) While creating the table Student last week, Ms. Sharma forgot to include the column
Game_Played. Now write a command to insert the Game_Played column with VARCHAR
data type and 30 size into the Student table? (1)
(d) In Marks column of ‘Student’ table, for Roll number 2, the Class Teacher entered the
marks as 45. However there was a totaling error and the student has got her marks
increased by 5. Which My ‘SQL command should she use to change the marks in
‘Student’ table. (1)
What will be the output of the following queries on the basis of the above table:
1 Ashi
2 Bimmi
4 Akash
COMMIT;
SAVEPOINT A;
SAVEPOINT B;
SAVEPOINT C;
ROLLBACK TO B;
Ans.(f) 1 Ashi
2 Bimmi
4 Abhi
5 Gagan
6 Chris
How many characters are occupied in attribute A ? How many characters are occupied
in attribute B? (2)
Ans(g) 4,20.
Help Sandhya in identifying Object Oriented language(s) from the above given list. (1)
Ans.(a)Java.
(b) Satyam is designing a frame in Netbeans containing list box. Help him in writing
suitable Java statement to extract selected item from a given listbox named “jList1.” (1)
Ans.(b) jList1.getSelectedIValue();
(c) What will be displayed in jTextField1 and jTextField2 after the following code is
executed: (1)
if (number <15)
jTextField1.setText(""+ number) ;
number++;
jTextField2.setText(""+ number) ;
else
jTextField1.setText("number1”) ;
number++;
jTextField2.setText("number2”) ;
Ans.(c)12
13.
String City="Delhi",PinCode="110001",Str="";
City=City+" "+PinCode;
JOptionPane.showMessageDialog(null,City);
int l=City.length();
int i=0;
while(i<l)
Str=Str+City.substring(6);
i=i+15;
JOptionPane.showMessageDialog(null,Str);
Ans.(d)Delhi 110001
110001.
int x=100;
for(int i=2;i<=22;i=i+4)
jTextArea1.append("\n"+(i+x));
x=x-2;
int i = 2;
while (i<=22)
jTextArea1.append("\n"+(i+x));
x=x-2;
i = i+4;
(f) The following code has error(s). Rewrite the correct code underlining all the
corrections made : (2)
do;
f=f*i;
i++;
jTextField1.setText(""+f);
do
f=f*i;
i++;
}while(i<=n);
jTextField1.setText(""+f);
(g) Mr. Pawan works as a programmer in “ABC Marketing Company” where he has
designed a Salary generator software to generate the salary of salesman in which Name
and Salary are entered by the user. A screenshot of the same is shown below:
(i.) After selecting appropriate Radio Button, when ‘Commission’ button is clicked,
commission should be displayed in the respective text field as each Salesman will get a
Commission
Units Sold
(in Rs.)
1 to 20 500
20 to 40 1000
>40 2000
int com=0;
if(jRadioButton1.isSelected())
com=500;
else if(jRadioButton2.isSelected())
com=1000;
else if(jRadioButton3.isSelected())
com=2000;
jTextField3.setText(“”+com);
(ii.) When ‘Gross Salary’ button is clicked, Gross Salary should be calculated and
displayed in the respective text field as per the given formula: (1)
int sal,comm;
sal=Integer.parseInt(jTextField2.getText
());
comm=Integer.parseInt(jTextField3.get
jTextField4.setText(“”+(sal+comm));
(iii.) After required selection of Checkbox(es), when ‘Facility Charges’ button is clicked,
Facility charges will be displayed in the respective text field according to the following
criteria: (2)
Facility Charges
Transport 500
Mess 2000
int extra=0;
if(jCheckBox1.isSelected())
extra=extra+500;
if(jCheckBox2.isSelected())
extra=extra+2000;
jTextField5.setText(“”+extra);
(iv.) Money will be deducted from the Gross Salary according to the facilities opted by
the employee. When ‘Net Salary’ button is clicked, Net Salary should be calculated and
displayed in the respective text field as per the given formulae: (1)
int amt,extra;
amt=Integer.parseInt(jTextField4.getText());
extra=Integer.parseInt(jTextField5.getText());
5 (a) Mrs. Sharma is the class teacher of Class ‘XII A’ She wants to create a table
‘Student’ to store details of her class. (2)
(ii) Name the Primary key of the table ‘Student’. State reason for choosing it.
(ii) Primary Key: Roll No as it will be unique for each student of the class.
(iii)SELECTRIGHT(CONCAT(‘PRACTICES’,’INFORMATICS’),5);
-16’);
(ii) NEST
(iii) ATICS
(iv) 16
(c) Table “Emp” is shown below. Write commands in SQL for (i) to (iv) and output for
(v) and (vi)
B-21 Model
2 Chavi 23 71000 99113423989
Town, Mumbai
KC-24, North
3 Karan 26 65000 98105393578
Avenue,Bhopal
A-152,Gomti
4 Raunaq 22 Nagar, 89000 99101393576
Lucknow
B-5/45, Uday
5 Kunal 27 80000 97653455654
Park, Delhi
(iii.) To count the number of employees with names starting with ‘K’
(iv.) To list names and addresses of those persons who have ‘Delhi’ in their address.
(v.) SELECT Name, Salary FROM Emp where salary between 50000 and 70000;
(vi). SELECT Name, phone from emp where phone like ‘99%’; (6)
Karan 65000
6 (a) Write SQL query to create a table ‘Player’ with the following structure: (2)
name varchar(50),
height integer,
weight integer,
datebirth date,
teamname varchar(50) );
Sales person
Name Age Salary
Id
1 Ajay 61 140000
2 Sunil 34 44000
5 Chris 34 40000
7 Amaaya 41 52000
Orders
10 2 54000
20 7 18000
30 1 46000
40 5 24000
(i.) The SalespersonId column in the "Salesperson" table is the _________ KEY. The Sales
person Id column in the "Orders" table is a ___________ KEY.
(ii.) Can the ‘SalespersonId’ be set as the primary key in table ‘Orders’. Give reason.
(c) With reference to the above given tables (in Q6 b), Write commands in SQL for (i)
and (ii) and output for (iii) below: (6)
(i.) To display SalespersonID, names, orderids and order amount of all salespersons.
ids and order ids of those sales persons whose names start with ‘A’ and sales amount is
(iii.) SELECT SalespersonId, name, age, amount FROM Salesperson, orders WHERE
Salesperson.salespersonId= Orders.salespersonId AND AGE BETWEEN 30 AND 45;
Ans.(c) (i) SELECT S.SalespersonID, Name, OrderID, Amount FROM Salesperson S, Orders O
WHERE S.SalespersonID= O.SalespersonID;
5 Chris 34 24000
7 Amaaya 41 18000
7 (a) ‘Bachpan Toys’ is a small company manufacturing toys. They have decided that it
would be beneficial to the company to create a website which would allow customers to
order toys on-line. State how ‘Bachpan Toys’ would benefit from the website. (2)
Ans.(a) Through online marketing (e-business) they can reach to many customers of far
away places in a cost effective manner. Also there is no need to incur huge cost of setting up
a shop/store to sell items.
(c) Lakshmi works for a school. She wishes to create controls on a form for the
following functions. Choose appropriate controls from Text field, Label, Radio button,
2 Select Stream
3 Select Subject
Ans.(c)