Monday, September 22, 2014

Informatics Practices Past year CBSE paper1

1
(a)

Which wireless communication channel is most appropriate in each of the following situation?
(i)            Communication in a hilly area.
(ii)          Very fast communication between two offices in two different countries.
1

Ans
(i)            Radio waves / Satellite
(ii)          Satellite






(b)

With what aim UNICODE was developed?
1

Ans
UNICODE was developed with the aim to  conceive a single standard code  which could manage to represent all languages of the world






(c)
Expand the following file extensions:
(i)            ODF
(ii)          XML
1

Ans
(i)            Open Document Format
(ii)          Extensible Markup Language






(d)
Give one example of URL and one example of domain name. 
1

Ans
Domain name :  www.cbse.nic.in








(e)
What is the use of repeater in a network ? How is it different from Hub?
2


Ans
Repeater is used to regenerate a signal which gets weakened during its transmission.
Difference between Hub and a repeater:
Repeater is used to amplify a weakened signal while a hub is used to redirect the received information to all the connected nodes in a broadcast mode.






(f)
Give two characteristics of Star Topology. Also, show it using a diagram with interconnection of 5 computers. 
2

Ans
Characteristics of Star topology
·         Easier to install
·          Fault diagnosis is easier
·         Easier to expand
·         Failure of hub/switch leads to failure of entire network.
·         Requires more cable length as compared to Bus topology

 
 

















(f)
What is snooping?
2

Ans.
Gaining unauthorized access to another person’s or organization’s data






2.
(a)
Name method is used to extract value of index while using ListBox in Java.
1

Ans.
getSelectedIndex()






(b)
What is the difference between the use of isSelected and setSelected methods used with JCheckBox in Java?
1

Ans
isSelected()   :           Returns true if the checkbox is selected otherwise it returns false.
setSelected() :           Checks  or Unchecks the checkbox .






(c)
Name any two commonly used methods of JComboBox control.
1

Ans
getSelectedItem( )
getSelectedIndex( )
setModel( )






(d)







Name any two attributes used in <img> tag of HTML.
1

Ans
Any two attribute from the following :
SRC / BORDER / ALIGN / HEIGHT /WIDTH /ALT






(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?

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

Ans.
Both the loop will execute 4 times

Loop 1 is Entry control loop .
Loop 2 is Exit control loop .







(f)
What will be displayed in JtextField1 and jTextField2 after execution of the following loop?
int Total=0,End=10;
for (int Turn=1;Turn<=End;Turn+=2)
     Total++;
jTextField1.setText(Integer.toString(Total));
     jTextField2.setText(Integer.toString(Turn));


2

Ans
jTextField1 = 5  // Statement 1
jTextField2 = 11 may also  be accepted for Statement 2






(g)
Differentiate between the <BR> and <HR> tags of HTML with suitable example.
2

Ans.
<BR> forces a line break on the web page while <HR> displays a horizontal line on the web page .







3
(a)
Write a command to add a NOT NULL constraint on FEES column of a student table.
1


Ans
ALTER TABLE STUDENT MODIFY FEES DECIMAL(5,2) NOT NULL;






(b)
Write SQL command to create a SAVEPOINT called A1.
1

Ans
SAVEPOINT A1;







(c)
Define foreign key with reference to RDBMS
1

Ans
Foreign key is a column within a table that points to a column or group of columns forming a primary key in another table. It is used to link 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

Ans
Cardinality     : 8
Degree                : 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?
SELECT COUNT(*) FROM CONTACTS;
SELECT COUNT(HOBBY) FROM CONTACTS;
2

Ans
Null values are included in query 1 but not in query 2.






(f)
Name the methods used to convert one type of data to another in the following statements of Java.
int Num=Integer.parseInt(jTextField1.getText()) ;
jTextField2.setText(Intger.toString(Num)) ;  
2

Ans.
Integer.parseInt( ) converts String to Integer
Integer.toString( ) converts Integer to String






(g)
Mr. Tondon is using table EMP with the following columns.
ECODE,DEPT,ENAME,SALARY
He wants to display all information of employees ( 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.
2

Ans
SELECT * FROM EMP ORDER BY ENAME, DEPT ;





4
(a)
What will be the content of jTextArea1 and TextField1 after execution of the following statements?

2

(i)
jTextArea1.setText(“Go\tGreen\nINDIA”);



Ans
Go   Green
INDIA






(ii)
String Message=”All The BEST”;
jTextField1.setText((Message.length()-6)+” “);


Ans
6






(b)
Rewrite the following program code using a while loop :
int Last=Integer.parseInt(jTextField1.getText());
for (int C = 1; C<=Last; C++)
     jTextArea1.setText(Integer.toString(C));
2

Ans
int Last=Integer.parseInt(jTextField1.getText());
int C=1;
while( C<=Last)
{
     jTextArea1.setText(Integer.toString(C));
     C++;
}






(c)
Observe the following code carefully and find which statement will never get executed in the code.
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 

1

Ans
Statement 7 won’t be executed






(d)
Write Java statement to make jButton1 disabled.
1

Ans
jButton1.setEnabled(false)






(e)
What will be displayed in jTextField1 after the execution of the following code?

int Sum,One=3, Two=5;
Sum= One + Two++;
jTextField1.setText(Integer.toString(Sum));
jTextField2.setText(Integer.toString(Two));

2

Ans.
8






(f)
What will be the contents of Text1 and Text2 after the following code is executed?
String Text2,Text1;
Text1= "Good Morning";
Text2= "India";
          Text1=Text2.concat(Text1);
2


Text11=IndiaGood Morning
Text2=India






(g)
SalaryShekher is a junior programmer at Educom 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:

If the Basic is less than 50000 then IncomeTax = Basic*0.2
And if is greater or equal to 50000 then IncomeTax = Basic*0.3
2

Ans

float b = Float.parseFloat(jTextField1.getText( ));
float tax = 0;
if(b<50000)
     tax=b*0.2;
else
     tax=b*0.3;
jTextField4.setText(“”+tax);








(ii)
To calculate Salary and display in jTextField5 on the click of Command Button “Calculate_Salary”.
Hint:
Salary= Basic+ DearnessAllowance+HouseRentAllowance)-IncomeTax.
2

Ans
float b,hra,da,tax;
b=Float.parseFloat(jTextField1.getText());
hra=Float.parseFloat(jTextField2.getText());
da=Float.parseFloat(jTextFiled3.getText());
tax=Float.parseFloat(jTextField4.getText());
float sal=b+hra+da-tax;
jTextField5.setText(“”+sal);






(iii)
To clear all Text Fields on the click of Command button “Clear”.
1

Ans
jTextField1.setText("");
jTextField2.setText("");
jTextField3.SetText("");
jTextField4.SetText("");
jTextField5.setText("");






5
(a)
What is the use of UPDATE statement in SQL? How is it different from ALTER statement?
2

Ans
UPDATE command is used to modify existing data in a table.
ALTER is used to modify the structure of an existing 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


Cardinality     : 4
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).




Table: GYM
ICODE
INAME
PRICE
BRANDNAME
G101
Power Fit Exerciser
20000
Power Gymea
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 names of the items whose name starts with ‘A’.                                                                                                         
1

Ans
SELECT INAME FROM GYM WHERE ITEM LIKE 'A%';






(ii)
To display ICODEs and INAMEs of all items, whose Brandname is Reliable or Coscore.                                                                                                         
1


Ans
SELECT ICODE,INAME FROM GYM
WHERE BRANDNAME=”RELIABLE” OR BRANDNAME= ”COSCORE”;

OR
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”.
1

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”
1

Ans
INSERT INTO GYM VALUES (”G107”, “VIBRO EXERCISER”, 21000,”GTCFITNESS”);






(v)
SELECT COUNT(DISTINCT(BRANDNAME)) FROM GYM;
1

Ans
COUNT(DISTINCT(BRANDNAME)) 
6






(vi)
SELECT MAX (PRICE) FROM GYM;
1

Ans
Max(PRICE)
30000






(vii)
SELECT INAME FROM GYM WHERE INAME LIKE “%T”;  
1

Ans
INAME
Message Belt






6.
(a)
Write MySql command to create the Table Vehicle with given constraint.

Table CHALLAN
COLUMN_NAME
DATATYPE(SIZE)
Constraint
Challan_No
Decimal(10)
Primary Key
Ch_date
Date

RegNo
Char (10)

Offence
Decimal (3)



2

Ans
CREATE TABLE CHALLAN
(
     Challan_No DECIMAL(10) PRIMARY KEY,
     Ch_date DATE,
     RegNo CHAR(10),
     Offence DECIMAL(3)

);







2

(b)
In a Database Karnataka_Sangam there are two tables with the instances given below:
Table : STUDENTS
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
ZW 12
4345677

Table : SPORTS
ADMNO
GAME
COACHNAME
GRADE
1215
Cricket
Mr. Rai
A
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

Ans

SELECT COUNT(ADDRESS) FROM STUDENTS;
OR
SELECT COUNT(*) FROM STUDENTS WHERE ADDRESS IS NOT NULL;






(ii)
To display Name, Class from STUDENT table and the corresponding Grade from SPORTS table.
2

Ans
SELECT NAME, CLASS, GRADE FROM STUDENT, SPORTS
WHERE STUDENT.ADMNO =SPORTS.ADMNO; 






(iii)
To display Name of the student and their corresponding Coachnames from STUDENTS and SPORTS tables
2

Ans
SELECT NAME, COACHNAME FROM STUDENT, SPORTS
WHERE STUDENT.ADMNO=SPORTS.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


(i)
Identify Primary key in the table Faculty.                                         
1

Ans
FNO






(ii)
Write SQL command to change the grade of Nishant to “A”.                                                                             
1

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

Ans
Benefits of e-Commerce
(i)         Helps reach customers effectively and speedily
(ii)        Helps customers to order on-line
(iii)       Helps in getting feedback from customers
(iv)       Helps business transactions

Example:
OR
any one e-Commerce site






(b)
Give two addresses of most commonly used e-Learning sites.
2

Ans







(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


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
S.No.
Function
Control
1
To select citizenship from a list of countries
Listbox/Combobox
2
To allow to input grade out of ‘A’ to ‘D’
Radio Button/Combo Box
3
To allow selecting one or many food items
ListBox/Check Box
4
To allow entering Feedback in the form of a paragraph
Textarea