Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

CBSE Class 12

Informatics Practices
Previous Year Question Paper 2013
Series: SKS/1 Code no. 90/1

● Please check that this question paper contains 8 printed pages.


● Code number given on the right hand side of the question paper should be
written on the title page of the answer-book by the candidate.
● Please check that this question paper contains 7 questions.
● Please write down the Serial Number of the question before
attempting it.
● 15 minute time has been allotted to read this question paper. The
question paper will be distributed at 10.15 a.m. From 10.15 a.m. to 10.30
a.m., the students will read the question paper only and will not write
any answer on the answer-book during this period.

INFORMATICS PRACTICES

Time Allowed: 3 hours Maximum Marks: 70


Instructions:
I. All questions are compulsory.
II. Answer the questions after carefully reading the text.

1. (a) Which wireless communication channel is most appropriate in each of the


following situations? 1 Mark
(i) Communication in a hilly area.

Class XII Informatics Practices www.vedantu.com 1


(ii)Very fast communication between two offices in two different countries.
Ans: (i) Radio Waves
(ii) Satellite
(b) With what aim UNICODE was developed? 1 Mark
Ans: UNICODE was developed with an aim to give a single standard code to
represent all the characters or languages in the world to ease the translation between
the languages.
(c) Expand the following file extensions : 1 Mark
(i) ODF
(ii) XML
Ans: ODF is for Open Document Format file while XML is for Extensible Markup
Language.
(d) Give one example of URL and one example of domain name. 1 Mark
Ans: URL: https://www.vedantu.com/masterclass
Domain: www.vedantu.com
(e) What is the use of repeater in a Network? How is it different from Hub?
2 Marks
Ans: Repeater is used to regenerate the signals as they get weak during their
transmission.
A hub is used to broadcast the received information to all the connected devices
while repeater regenerates the received signals and forward them.
(f) Give two characteristics of Star Topology. Also, show it using a diagram with
interconnection of 5 computers. 2 Marks
Ans: (i) It is easier to install.
(ii) It is easier to find faults in the network.

Class XII Informatics Practices www.vedantu.com 2


(g) What is Snooping? 2 Marks
Ans: Snooping is having unauthorized access to someone else’s data. It is like
watching someone’s typed keys while they enter a password or keeping a check on
their activity on a computer or network.

2. (a) Name method is used to extract value of Index while using ListBox in
Java. 1 Mark
Ans: getSelectedIndex() can be used to extract the value of the index while using
ListBox.
(b) What is the difference between the use of isSelected and setSelected methods
used with JCheckBox in Java? 1 Mark
Ans: isSelected is used to check if the checkbox is selected by the user or not and
returns true or false while setSelected is used to check or uncheck the checkbox.
(c) Name any two commonly used methods of JComboBox control. 1 Mark
Ans: getSelectedItem() and getSelectedIndex()
(d) Name any two attributes used in <img> tag of HTML. 1 Mark
Ans: src and alt or border.
(e) How many times the following loops will execute the statements inside it?
Which one of them is Entry Control and which one is Exit Control? 2 Marks

Class XII Informatics Practices www.vedantu.com 3


Loop 1 Loop 2
int j=8,total=0; int j=8,total=0;
while(j>1) do
{ {
total+=j; total+=j;
j-=2; j-=2;
} }while(j>1);

Ans: Loop 1 and Loop 2 both will be executed 4 times.


Loop 1 is an entry control loop whereas Loop 2 is an exit control loop.
(f) What will be displayed in jTextField1 and jTextField2 after the execution of
the following loop? 2 Marks
int Total=0,End=10;
for(int Turn=1;Turn<=End;Turn+=2)
Total++;
jTextField1.setText(Integer.toString(Total));
jTextField2.setText(Integer.toString(Turn));
Ans: TextField1: 5
TextField2:11
(g) Differentiate between the <BR> and <HR> tags of HTML with suitable
examples. 2 Marks
Ans: <BR> will break the line on the web page while <HR> will draw a horizontal
line on the web page.
Example: On a web page <br>a break will be created<hr>a horizontal line will be
created.
Output:
On a web page
a break will be created
a horizontal line will be created.

Class XII Informatics Practices www.vedantu.com 4


3.(a) Write a command to add a NOT NULL constraint on FEES column of a
student table. 1 Mark
Ans: ALTER TABLE STUDENT MODIFY FEES DECIMAL (4,2) NOT NULL;
(b) Write SQL command to create a SAVEPOINT called A1. 1 Mark
Ans: SAVEPOINT A1;
(c) Define Foreign Key with reference to RDBMS. 1 Mark
Ans: Foreign Key is a column in a table which points to the primary key of another
table. It acts like a link between those two tables.
(d) Table BANK has 2 rows and 3 columns. Table CUSTOMER has 4 rows and
3 columns. What will be the cardinality and degree of the Cartesian product of
them? 1 Mark
Ans: Cardinality = 2*4 = 8 and degree = 3+3 = 6.
(e) There is a column HOBBY in a Table CONTACTS. The following two
statements are giving different outputs. What may be the possible reason?
2 Marks
SELECT COUNT(*) FROM CONTACTS;
SELECT COUNT(HOBBY)FROM CONTACTS;
Ans: 1st query will give the count of total number of records while 2nd query wil
give the count of records where Hobby column is not null.
(f) Name the methods used to convert one type of data to another in the
following statements of Java. 2 Marks
int Num=Integer.parseInt(jTextFieldl.getText());
jTextField2.setText(Integer.toString(Num));
Ans: Integer.parseInt() is used to convert string into integer and Integer.toString() is
used to convert integer into string.
(g) Mr. Tondon is using table EMP with the following columns. 2 Marks
ECODE,DEPT,ENAME,SALARY

Class XII Informatics Practices www.vedantu.com 5


He wants to display all information of employee (from EMP table) in ascending
order of ENAME and within it in ascending order of DEPT. He wrote the
following command, which did not show the desired output.
SELECT * FROM EMP ORDER BY NAME DESC,DEPT;
Rewrite the above query to get the desired output.
Ans: SELECT * FROM EMP ORDER BY ENAME, DEPT;

4. (a) What will be the content of jTextArea1 and TextField1 after the execution
of the following statements? 2 Marks
(i) jTextArea1. setText ("Go\tGreen\nINDIA")
(ii) String Message="All The Best";
jTextField1.setText((Message.length()-6)+" ");
Ans: jTextArea1 = Go Green
INDIA
jtextField1 = 6
(b) Rewrite the following programme code using a while loop statement:
2 Marks
int Last=Integer.parseint(jTextField1.getText());
for (int C=1;C<=Last;C++ )
jTextArea1.setText (Integer.toString(C));
Ans: int Last=Integer.parseInt(jTextField1.getText());
int C=1;
while( C<=Last)
{
jTextArea1.setText(Integer.toString(C));
C++;

Class XII Informatics Practices www.vedantu.com 6


}
(c) Observe the following code carefully and find which statement will never get
executed in the code. 1 Mark
int Count=1; //Statement 1
do //Statement 2
{ //Statement 3
if (Count<15) //Statement 4
jTextField1.setText("Jump"); //Statement 5
else //Statement 6
jTextField1.setText("Stop"); //Statement 7
Count+=4; //Statement 8
} //Statement 9
while(t<=15); //Statement 10
Ans: Statement 7 will never be executed as it will only be executed when Count =
15 and Count will have value 15.
(d) Write Java statement to make jButton1 disabled. 1 Mark
Ans: jButton1.setEnabled(false);
(e) What will be displayed in jTextField1 after the execution of the following
code? 2 Marks
int Sum,One=3,Two=5;
Sum = One + Two++;
jTextField1.setText(Integer.toString(Sum));
jTextField2.setText(Integer.toString(Two);
Ans: jTextField1 = 8
(f) What will be the contents of Text1 and Text2 after the following code is
executed? 2 Marks

Class XII Informatics Practices www.vedantu.com 7


String Text2, Text1;
Text1= "Good Morning";
Text2= "India";
Text1=Text2.concat(Text1);
Ans: Text1: IndiaGood Morning
Text2: India
(g) Shekher is a junior programmer at ducom Enterprises. He created the
following GUI in Netbeans.

Help him to write code for the following :


(i) To calculate Income Tax to be paid and display in jTextField4 on the click
of Command Button "Calculate Income Tax" as per the following condition:
2 Marks
If the Basic is less than 50000 then lncomeTax =Basic*0.2
And if is greater or equal to 50000 then lncomeTax=Basic*0.3
Ans: //Calculate Income Tax
float basic = Float.parseFloat(jTextField1.getText( ));

Class XII Informatics Practices www.vedantu.com 8


float tax = 0;
if(basic<50000)
tax=basic*0.2;
else
tax=basic*0.3;
jTextField4.setText(“”+tax);
(ii) To calculate Salary and display in jTextField5 on the click of Command
Button "Calculate_Salary". 2 Marks
Hint: Salary = (Basic + DeamessAllowance + HouseRentAllowance) -
IncomeTax.
Ans: //Calculate_Salary
float basic,hr_allow,d_allow,tax;
basic=Float.parseFloat(jTextField1.getText());
hr_allow=Float.parseFloat(jTextField2.getText());
d_allow=Float.parseFloat(jTextFiled3.getText());
tax=Float.parseFloat(jTextField4.getText());
float salary=basic+hr_allow+d_allow-tax;
jTextField5.setText(“”+sal)
(iii) To Clear all Text Fields on the click of Command Button "Clear". 1 Mark
Ans: //Clear
jTextField1.setText("");
jTextField2.setText("");
jTextField3.SetText("");
jTextField4.SetText("");
jTextField5.setText("");

Class XII Informatics Practices www.vedantu.com 9


5.(a) What is the use of UPDATE statement in SQL ? How is it different from
ALTER statement? 2 Marks
Ans: UPDATE statement is used to update the record values in a table.
ALTER statement is used to change the structure of the table while UPDATE
statement is used to change the values in the table.
(b) Mr. Shankar created a table VEHICLE with 3 rows and 4 columns. He
added 1 more rows to it and deleted one column. What is the Cardinality and
Degree of the Table VEHICLE? 1 Mark
Ans: Cardinality = 4 and degree = 3
(c) Consider the following table named "GYM" with details about fitness items
being sold in the store. Write command of SQL for (i) to (iv) and output for (v)
to (vii). 7 Marks
Table : GYM

ICODE INAME PRICE BRANDNAME

G101 Power Fit Exerciser 20000 PowerGymea

G102 Aquafit Hand Grip 1800 Reliable

G103 Cycle Bike 14000 Ecobike

G104 Protoner Extreme Gym 30000 Coscore

G105 Message Belt 5000 MessagExpert

G106 Cross Trainer 13000 GTCFitness

(i) To display the names of all the items whose name starts with "A".
Ans: SELECT INAME FROM GYM WHERE ITEM LIKE 'A%';
(ii) To display ICODEs and INAMEs of all items, whose BrandName is Reliable
or Coscore.

Class XII Informatics Practices www.vedantu.com 10


Ans: SELECT ICODE, INAME FROM GYM WHERE BRANDNAME IN
(”RELIABLE”, ”COSCORE”);
(iii) To change the BrandName to "Fit Trend India" of the item, whose ICODE
as "G101".
Ans: UPDATE GYM SET BRANDNAME =”Fit Trend India” WHERE
ICODE=”G101”;
(iv) Add a new row for a new item in GYM with the details: "G107", "Vibro
exerciser", 21000, ''GTCFitness".
Ans: INSERT INTO GYM VALUES (”G107”, “Vibro exerciser”,
21000,”GTCFitness”);
(v) SELECT COUNT (DISTINCT(BRANDNAME))FROM GYM;
Ans: COUNT(DISTINCT(BRANDNAME))
6
(vi) SELECT MAX(PRICE) FROM GYM;
Ans: Max(PRICE)
30000
(vii) SELECT INAME FROM GYM WHERE INAME LIKE "%t";
Ans: INAME
Message Belt

6.(a) Write SQL command to create the table Vehicle with given constraint.
2 Marks
Table: CHALLAN

COLUMN_NAME DATATYPE(SIZE) CONSTRAINT


Challan_No Decimal(10) Primary Key
Ch_date Date

Class XII Informatics Practices www.vedantu.com 11


RegNo Char(10)
Offence Decimal(3)

Ans: CREATE TABLE CHALLAN(


Challan_No Decimal(10) PRIMARY KEY,
Ch_Date Date,
RegNo Char(10),
Offense Decimal(3)
);
(b) In a Database Karnataka_Sangam there are two tables with the instances
given below:
Table : STUDENT

ADMNO NAME CLASS SEC RN ADDRESS PHONE

1211 Meena 12 D 4 A-26 2345678

1212 Vani 10 D 1 B-25 5456789

1213 Meena 12 A 1

1214 Karish 10 B 3 AB-234 4567890

1215 Suraj 11 C 2 ZW12 4345677

Table : SPORTS

ADMNO GAME COACHNAME GRADE

1215 Cricket Mr. Rai A

Class XII Informatics Practices www.vedantu.com 12


1213 VollyBall Ms. Chadha B

1211 VollyBall Mr. Govardhan A

1212 Basket Ball Mr. Tiwani B

Write SQL queries for the following :


(i) To count how many addresses are not having NULL values in the address
column of students table. 2 Marks
Ans: SELECT COUNT(ADDRESS) FROM STUDENTS;
(ii) To display Name, Class from STUDENT table and the corresponding
Grade from SPORTS table. 2 Marks
Ans: SELECT NAME, CLASS, GRADE FROM STUDENT as St, SPORTS as Sp
WHERE St.ADMNO =Sp.ADMNO;
(iii) To display Name of the student and their corresponding Coachnames from
STUDENTS and SPORTS tables. 2 Marks
Ans: SELECT NAME, COACHNAME FROM STUDENT as St, SPORTS as Sp
WHERE St.ADMNO=Sp.ADMNO;
(c) Answer the questions (i) and (ii) based on the following table:
Table: FACULTY

FNO FNAME AGE DEPARTMENT GRADE

111 Moksha 40 Biology A

123 Malini 35 Maths A

125 Akshit 43 English B

130 Nishant 27 Maths B

Class XII Informatics Practices www.vedantu.com 13


(i) Identify the Primary Key in the Table FACULTY. 1 Mark
Ans: FNO is the primary key in the table FACULTY.
(ii) Write SQL Command to change the Grade of Nishant to "A". 1 Mark
Ans: UPDATE FACULTY SET GRADE=”A” WHERE FNAME=”NISHANT”;

7.(a) How popularity of e-Commerce has benefitted a common man? Give the
domain name of one popular e-Commerce site. 2 Marks
Ans: e-Commerce has benefitted a common man with:
● No reach limitations for buyer or seller
● Easy product and price comparison.
Domain Name of e-commerce site: www.amazon.com or www.flipkart.com
(b) Give two addresses of most commonly used e-Learning sites. 1 Mark
Ans: www.w3schools.com and www.vedantu.com
(c) Shobhit is creating a form for his company. Help her to choose most
appropriate controls from ListBox, ComboBox, TextField, TextArea,
RadioButton, CheckBox, Label and Command Button for the following entries.
2 Marks

S.No Function

1 To select citizenship from a list of countries

2 To allow to input grade out of ' A' to ' D'

3 To allow selecting one or many food items

4 To allow entering Feedback in the form of a paragraph

Ans: ListBox/ComboBox for Countries, RadioButton/ComboBox for Grade


CheckBox for FoodItems and TextArea for Feedback.

Class XII Informatics Practices www.vedantu.com 14

You might also like