11411solved Sample Paper 2012 XII IP

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

CBSEGuess.

com

CLASS XII
SAMPLE PAPER-065
INFORMATICS PRACTICES
Time: 3 hrs. M.M. 70

Note: All questions are compulsory.


Marks are allotted against each question.
Q 1. Answer the following questions:-
a) Mr. Abhinav wants to implements a network using less cable length and data should be transmitted [2]
in one direction only. Name the topology and direction of data transmission.
Ans: Ring/Circular Topology and Anti-Clock wise
b) Explain the uses of the following devices in networking- [2]
i) Switch ii) Repeater
Ans:
i) Switch: A switch is responsible for filtering data in a specific way and for forwarding packets
between LAN segments.
ii) Repeater: It is a network device that amplifies and restores the signals for long distance
transmissions.
c) What do you mean by Communication Channel? Name any two. [2]
Ans: Transmission Media (Communication Channels): The cable that connects two or more
nodes is the communication channels. It can be categories in two types- Guided (Wired
Technology) & Unguided (Wireless Technology). Eg. Twisted Pair Cable (Ethernet Cable),
Coaxial Cable, Optical Fibers, Microwave, Radio Wave, Satellite, Infrared, Bluetooth
d) Ms. Kiran has downloaded software from internet. It can be distributed and freely used by any one. [1]
Source code is not available. Name the software downloaded by her.
Ans: Freeware
e) Write any two preventive measures for network security. [1]
Ans: Preventive Measures for network security-(any two)
 Implement proper security policy for your organization
 Use proper file access permissions when sharing files on Internet
 Disconnect from the Internet when away
f) Write any two advantages of open standard. [1]
Ans: Advantages of Open Standards-(any two)
a) Making the data accessible to all
b) Application and platform independent
c)No hidden information
d)Diversity and interoperability in the industry
e)Offers diverse choice for users
g) Differentiate between Phonetic Text Entry and Key map based Entry of Indian language text. [1]
Ans: Phonetic Text Entry (Transliteration): In this type of text entry, traditional keyboards with
English keys are used. But while typing, the Indian alphabets are written phonetically (i.e., the way

--------------------------------------------------------------------------------------------------------
CBSE Sample Papers | CBSE Guess Papers | CBSE Practice Papers | Important Questions | CBSE PSA | CBSE OTBA |
Proficiency Test | 10 Years Question Bank | CBSE Guide | CBSE Syllabus | Indian Tutors | Teacher' Jobs CBSE eBooks |
Schools | Alumni | CBSE Results | CBSE Datesheet | CBSE News
CBSEGuess.com

they sound as per the pronunciation) in English Script and then converted to corresponding language
word. For e.g. we will type "mera desh mahaan" from English keyboard and the relevant phonetic key
entry software will transliterate it in the language selected eg. Hindi.("esjk ns'k egku")
Keymap based Entry: In this method the keyboard keys are mapped to specific characters using a
keymap. The whole arrangement of mapping the keyboard keys to specific language characters is
known as keymap.

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 [1]
named lblAmount.
Ans: lblAmount.setText(“ ”+amount);
b) What is the purpose of break statement in switch…case statement? [1]
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. [1]
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. [1]
Ans: Features of XML (any two)
1. XML is free and extensible
2. XML is platform independent
3. Can be used to create new language
4. It is designed to Carry data, not to display data.
e) What will be the output after executing the following code? [2]
int fun(int n)
{ int r=(n%2==0)?1:0;
return r;
}
int t=5,p;
do
{ p=fun(t);
if(p==1)
System.out.println(t+p);
else
System.out.print(t+p);
}while(++t<10);

Ans: 57
79
9
f) Write a method in Java that takes an year (4-digit) and return true if year is leap, otherwise false. [2]
Ans: boolean funLeap(int year)
{ if(year%4==0 && year%100!=0 || year%400==0)
return true;

--------------------------------------------------------------------------------------------------------
CBSE Sample Papers | CBSE Guess Papers | CBSE Practice Papers | Important Questions | CBSE PSA | CBSE OTBA |
Proficiency Test | 10 Years Question Bank | CBSE Guide | CBSE Syllabus | Indian Tutors | Teacher' Jobs CBSE eBooks |
Schools | Alumni | CBSE Results | CBSE Datesheet | CBSE News
CBSEGuess.com

else
return false;
}
g) What are the uses of the following tags:- [2]
<HTML>, <SUP>, <H1>, <TR>
Ans: <HTML> - Identifies that the document is a HTML document.
<SUP> - Displays the text in superscript way. i e. a2+b2
<H1> - Displays text in Heading format (for largest heading size)
<TR> - Used to specify table row, it is contained in <TABLE> tag.

Q 3. a) If a database “Library” exists. Write the command to start working in this database. [1]
Ans: USE Library;
b) While creating a table “MobDet”, Kavita forgot to set primary key for the table. Write the statement [1]
to set the column MobileNo as the primary key of the table.
Ans: ALTER TABLE MobDet ADD PRIMARY KEY (MobileNo);
c) Avani has created a table named “Doctor”, she wants to increase the OPDCharge by 25% of [1]
“Nephro” and “Cardio” department. She wrote a query-
UPDATE Nephro,Cardio SET OPDCharge=25% WHERE department IN (‘Nephro’,’Cardio’);
Help Avani to run the query by removing the errors from the query and write corrected query.
Ans: UPDATE Doctor SET OPDCharge= OPDCharge + OPDCharge *0.25 WHERE department
IN (‘Nephro’,’Cardio’);
d) Abhi wants to undo the changes made during the transaction execution. What command should [1]
Abhi use for this purpose?
Ans: ROLLBACK; (ROLLBACK works only when START TRANSACTION /BEGIN command
is issued)
e) Identify the candidate key(s) in the following table. [2]
Relation: Data
EmpNo
Name
Designation
MobileNo
PANCardNo
Salary
BankAccountNo
Ans: EmpNo, MobileNo, PANCardNo, BankAccountNo
f) GarCode, GarName, Price and FabrCode of table “GARMENT” are given below- [2]
GarCode GarName Price FabrCode
10015 Informal Pant 1899 F02
10089 Formal Pant 1295 F01
10075 Shirt 690 F01
10036 Frock 690 F04
Based on this information, find output of the following queries.
a) SELECT COUNT(Distinct FabrCode)) FROM GARMENT;
b) SELECT GarName FROM GARMENT WHERE FabrCode NOT LIKE ‘__1’;
Ans: a) 3
b) Informal Pant
Frock

--------------------------------------------------------------------------------------------------------
CBSE Sample Papers | CBSE Guess Papers | CBSE Practice Papers | Important Questions | CBSE PSA | CBSE OTBA |
Proficiency Test | 10 Years Question Bank | CBSE Guide | CBSE Syllabus | Indian Tutors | Teacher' Jobs CBSE eBooks |
Schools | Alumni | CBSE Results | CBSE Datesheet | CBSE News
CBSEGuess.com

g) What is the role of UNIQUE constraint? How is PRIMARY KEY constraint different from [2]
UNIQUE constraint?
Ans: UNIQUE constraint works same as Primary Key constraint but,
UNIQUE Attribute can be NULL but PRIMARY KEY can not be NULL.
UNIQUE can be assigned to many attribute but PRIMARY KEY can be assigned to one
attribute only in a table.

Q 4. a) What is method overriding? [1]


Ans: A method in a sub class hides or overshadows a method inherited from the super class if
both methods have the same signature. This property is known as overriding the inherited
method.
b) What is the difference between setEnabled and setVisible methods of a control? [1]
Ans: setEnabled method makes the control accessible or inaccessible but control displays on
screen whereas setVisible method makes the control visible or invisible on the screen
c) Write the purpose of the following statements. [1]
i) jTextField1.setText("Value"+Math.round(-11.5)); ii) final double g=9.8;
Ans: i) It will round off the number and display in text field1 – Value -11
ii) It will declare a constant g with initial value 9.8
d) Rewrite the following code using if ..else. [2]
switch(ch) {
case ‘a’:
case ‘A’:
case ‘e’:
case ‘E’:
case ‘i’:
case ‘I’:
case ‘o’:
case ‘O’:
case ‘u’:
case ‘U’: ++v;
break;
default: others++;
}
Ans:
if(ch==’A’ || ch==’a’ || ch==’E’ || ch==’e’ || ch==’I’ || ch==’i’ || ch==’O’ || ch==’o’ || ch==’U’ || ch==’u’ )
++v;
else
others++;
e) The following code has some error(s). Rewrite the correct code underlining all the corrections made. [2]
int i,c,a=5,b=0;
for(i=0,i<20,i++)
{ if b=0 then
break;
else
c=a/b;
system.out.show(“Quotient”+c);

Ans: int i,c,a=5,b=0;

--------------------------------------------------------------------------------------------------------
CBSE Sample Papers | CBSE Guess Papers | CBSE Practice Papers | Important Questions | CBSE PSA | CBSE OTBA |
Proficiency Test | 10 Years Question Bank | CBSE Guide | CBSE Syllabus | Indian Tutors | Teacher' Jobs CBSE eBooks |
Schools | Alumni | CBSE Results | CBSE Datesheet | CBSE News
CBSEGuess.com

for(i=0;i<20;i++) // at place of comma(,) semicolon (;) should be there


{ if (b==0) // comparison operator = = should be used and brackets are missing.
break;
else
c=a/b;
System..out.Println(“Quotient”+c);
f) What will be the content of jTextField1 and jTextField2 after executing the following code? [2]
String st="Happy New Year 2012";
jTextField1.setText(""+st.substring(17)+st.length());
jTextField2.setText(st.substring(6).trim());

Ans: jTextField1 will contain 1219 and jTextField2 will contain New Year 2012
g) Dream Land Enterprises has computerized its billing. The following data entry screen is used to [6]
generate bill.

The criteria for calculation of delivery and handling charges is as given below-
Category of City Charges
A Class Rs. 3500
B Class Rs. 4000
C Class Rs. 4500

I. Write the code to make the text fileds txtSubTotal, txtTax, txtDelHanCh and txtTotal non
editable and set the category of city as C class.
II. Write code to do the following-
a) Write the code for Calculate button to calculate and display Sub Total, Tax, Delivery &
Handling Charges and Total depending on the category of the city.
o Sub Total is calculated as Unit Price * Quantity.

--------------------------------------------------------------------------------------------------------
CBSE Sample Papers | CBSE Guess Papers | CBSE Practice Papers | Important Questions | CBSE PSA | CBSE OTBA |
Proficiency Test | 10 Years Question Bank | CBSE Guide | CBSE Syllabus | Indian Tutors | Teacher' Jobs CBSE eBooks |
Schools | Alumni | CBSE Results | CBSE Datesheet | CBSE News
CBSEGuess.com

o Tax is calculated as 7.85% of Sub Total


o Total is calculates as the sum of Sub Total, Tax and Delivery and Handling Charges. If
Company Employee check box is checked then tax should be 2.5%.
b) When Clear button is clicked all the text boxes should be clear and Close the application when
Exit button is pressed.

Ans: I. txtSubTotal.setEditable(False);
txtTax.setEditable(False);
txtDelHanCh.setEditable(False);
txtTotal.setEditable(False);
optCClass.setSelected(True);
II. a) Code for Calculate Button
double qty,unitPrice, tax, subtotal, dhCharges,total
qty=Double.parseDouble(txtQuantity.getText());
unitPrice=Double.parseDouble(txtUnitPrice.getText());
subtotal= qty* unitPrice;
if(chkCompEmpl.isSelected()==True)
tax=subtotal*(2.5/100);
else
tax= subtotal *(7.85/100);
if(optAClass.isSelected()==True)
dhCharges=3500;
if(optBClass.isSelected()==True)
dhCharges=4000;
if(optCClass.isSelected()==True)
dhCharges=4500;
total=subtotal+tax+dhCharges;
txtSubTotal.setText(“ “+subtotal);
txtTax.setText(“ “+tax);
txtDelHanCh.setText(“ “+dhCharges);
txtTotal.setText(“ “+total);
b) Code For Clear Button-
txtQuantity.setText(“ “);
txtQuantity.setText(“ “);
txtSubTotal.setText(“ “);
txtTax.setText(“ “);
txtDelHanCh.setText(“ “);
txtTotal.setText(“ “);
or
txtTotal.setText(null); //null can also be used.
Code for Exit Button-
System.exit(0);

Q 5. a) Explain the need of GROUP BY clause in SELECT query with example. [2]
Ans: GROUP BY clause is used to group all those records that have identical values in a
particular field or a group of fields (attribute). Eg.
SELECT stream, Count(*)

--------------------------------------------------------------------------------------------------------
CBSE Sample Papers | CBSE Guess Papers | CBSE Practice Papers | Important Questions | CBSE PSA | CBSE OTBA |
Proficiency Test | 10 Years Question Bank | CBSE Guide | CBSE Syllabus | Indian Tutors | Teacher' Jobs CBSE eBooks |
Schools | Alumni | CBSE Results | CBSE Datesheet | CBSE News
CBSEGuess.com

FROM student
GROUP BY stream;
It will display the stream wise no. of students.

b) Write output of the following SQL queries : [2]


i) SELECT DAYOFMONTH(‘2010-12-23’);
ii) SELECT TRUNCATE(170,-2);
iii) SELECT INSTR(‘Coordination ‘,’o’);
iv) SELECT CONCAT(‘India’,NULL,’Australia’);

Ans: i) 23
ii) 100
iii) 2
iv) NULL
c) Consider the table given below, write command in SQL for (1) to (4) and output for (5) to (8). [6]
Table : STUDENT
No Name Stipend Stream AvgMark Grade ClassSec
1 Karan 800 Medical 67.8 C 11D
2 Vishu 1500 Commerce 82.6 B 12B
3 Prabhat 2000 Humanities 85.7 B 12J
4 Selina 700 Medical 88.9 A 11C
5 Vinod 900 Science 65.9 C 11D
6 Karan 1200 Medical 68.6 D 12J

(1) To display the name and stream of all students who are in class 12.
(2) To display the different Streams available for students.
(3) To display name, avgmarks and grade in ascending order of grade.
(4) To display names of those students whose grade and section are same.
(5) SELECT Stipend+500 FROM Student WHERE stream LIKE ‘%ma%’;
(6) SELECT COUNT(*) FROM Student WHERE grade=’C’ OR stipend =800;
(7) SELECT ClassSec FROM Student WHERE Avgmark>68 && stream=’Medical’;
(8) SELECT AVG(stipend) FROM Student WHERE name=’Karan’;

Ans: (1) SELECT name,stream


FROM student
WHERE classSec LIKE ‘12%’;
Or
SELECT name,stream
FROM student
WHERE LEFT(classSec,2)=‘12’;
(2) SELECT DISTINCT stream
FROM student;
(3) SELECT name, AvgMark, Grade
FROM student
ORDER BY Grade ASC;
(4) SELECT name
FROM student

--------------------------------------------------------------------------------------------------------
CBSE Sample Papers | CBSE Guess Papers | CBSE Practice Papers | Important Questions | CBSE PSA | CBSE OTBA |
Proficiency Test | 10 Years Question Bank | CBSE Guide | CBSE Syllabus | Indian Tutors | Teacher' Jobs CBSE eBooks |
Schools | Alumni | CBSE Results | CBSE Datesheet | CBSE News
CBSEGuess.com

WHERE RIGHT(classSec,1)=Grade;
(5) 2500
(6) 2
(7) 11C
12J
(8) 1000

Q 6. Answer the following question.


a) Write an SQL query to create the table “Club“ with the following structure- [2]

Field Type Constraint


CoachId Integer(6) Primary Key
CoachName Varchar(25) Not NULL
Age Integer(3) Must be more than 35
Sports Varchar(20)
Pay Integer(8)
Sex Char(1)
Ans:
CREATE TABLE club (CoachId INT(6) PRIMARY KEY, CoachName Varchar(25) NOT
NULL, Age INT(3) CHECK Age>35, Sports Varchar(20), Pay INT(8), Sex Char(1));

b) In a database there are two tables ‘Doctors’ and ‘Patients’ shown below- [2]

Table: Doctors
DId DName OPDDays Timing
D521 R. K. Sinha Monday 10 am
D324 V. K.Singha Wednesday 9 am
D945 P. Kumar Friday 12 pm
D457 V. Prasad Saturday 10 am
D125 K. Krishna Tuesday 11 am
D220 M. Kumar Monday 12 pm

Table: Patients
PId Name Age Dept DateOfAdm Charges Gender DId
115 Jugal 36 Nephro 2005-12-15 260 M D324
621 Smita 45 Cardiology 2007-07-20 450 F D945
451 Reena 14 ENT Null Null F D457
136 Kishor 64 Surgery 2001-08-28 850 M D521

i) Name the column(s) that can be used to retrieve data from both the tables.
ii) Identify the Primary key and Foreign Key attributes from both the tables.
Ans: i) DId ( from Doctors and Patients table)
ii) PId – Primary Key ( Patient Table)
DId- Foreign Key (Patient Table)
DId- Primary Key ( Doctors Table)
c) Consider the tables given below- [6]

--------------------------------------------------------------------------------------------------------
CBSE Sample Papers | CBSE Guess Papers | CBSE Practice Papers | Important Questions | CBSE PSA | CBSE OTBA |
Proficiency Test | 10 Years Question Bank | CBSE Guide | CBSE Syllabus | Indian Tutors | Teacher' Jobs CBSE eBooks |
Schools | Alumni | CBSE Results | CBSE Datesheet | CBSE News
CBSEGuess.com

Table : Staff
StaffId Name Dept Gender Experience
1125 Noopur Sales F 12
1263 Kartik Finance M 6
1452 Palak Research F 3
236 Nayan Sales M 8
366 Anvashan Finance M 10
321 Sawan Sales M 7

Table : Salary
StaffId Basic Allowance CommPer
1125 14000 1500 9
1263 25000 2800 6
236 13500 1400 5
321 12000 1500 5
366 26100 3100 12

With reference to above tables, write commands in SQL for (i) and (ii) and output for (iii)-
(i) To display name of all the staff that are in Sales having more than 9 years experience and
commission percentage is more than 8.
(ii) To display average salary of staff working in Finance department. (Salary=Basic+allowance)
(iii) SELECT name, Basic from Staff, Salary WHERE Dept=’Sales’ and Staff.StaffId=Salary.StaffId;
Ans: i) SELECT Name
FROM Staff, Salary
WHERE Dept=’Sales’ AND Experience>9 AND CommPer>8 AND
Staff.StaffId=Salary.StaffId;
ii) SELECT AVG(Basic+Allowance) AS “Average Salary”
FROM Staff, Salary
WHERE Staff.StaffId=Salary.StaffId AND Dept=’Finance’;
iii) Noopur 14000
Nayan 13500
Sawan 12000

Q 7. a) What is e-Governance? Name any two major e-Governance projects in India. [2]
Ans: E-Governance refers to the application of electronic means in governance with an aim of
fulfilling the requirements of a common man at affordable costs and in fastest possible time.
Two projects are- Income Tax Portal, DRDO Project, Indian Courts, Supreme Court of India,
RTI Portal etc.
b) What is database connectivity? [1]
Ans: Database Connectivity refers to a programming interface through that front end access a
database on a backend via same means.
c) Mr. Anubhav is working as a programmer in a Hotel. He wants to create the forms to add the details [2]
of customers. Choose appropriate controls from Text Field, Label, Radio Button, Check Box, List Box,
Combo Box, and Command Button and write in the third column.
SNo Control Used to Control

--------------------------------------------------------------------------------------------------------
CBSE Sample Papers | CBSE Guess Papers | CBSE Practice Papers | Important Questions | CBSE PSA | CBSE OTBA |
Proficiency Test | 10 Years Question Bank | CBSE Guide | CBSE Syllabus | Indian Tutors | Teacher' Jobs CBSE eBooks |
Schools | Alumni | CBSE Results | CBSE Datesheet | CBSE News
CBSEGuess.com

1 Enter Name of Customer


2 Select Room Type
3 To display current date
4 Selection for extra facilities like Laundry, Food, Gym

Ans:
SNo Control Used to Control
1 Enter Name of Customer Text Field
2 Select Room Type Combo/ Radio Button
3 To display current date Label
4 Selection for extra facilities like Laundry, Food, Gym Check Box/ List Box

**** Best of Luck ******

Marking Pattern:

Theory :
Networking & Open Source –10 Marks
Java - 20 Marks
HTML- 5 Marks
IT Application – 5 Marks
MySQL – 30 Marks
Total - 70 Marks

Practical:
Java – 10 Marks (A Program)
MySQL – 4 Marks (Queries on a table)
Records File – 6 Marks
Project Work – 4 Marks
Viva – 6 Marks
Total – 30 Marks

By:
Vinay Kumar Srivastava
PGT Computer Science
Email: [email protected]

--------------------------------------------------------------------------------------------------------
CBSE Sample Papers | CBSE Guess Papers | CBSE Practice Papers | Important Questions | CBSE PSA | CBSE OTBA |
Proficiency Test | 10 Years Question Bank | CBSE Guide | CBSE Syllabus | Indian Tutors | Teacher' Jobs CBSE eBooks |
Schools | Alumni | CBSE Results | CBSE Datesheet | CBSE News

You might also like