SET-I
KENDRIYA VIDYALAYA SANGATHAN, CHENNAI REGION
CLASS XII-COMMON PRE-BOARD EXAMINATION - 2013-2014
MARKING SCHEME
Subject: Informatics Practices (065) Time Allowed: 3hrs Maximum Marks: 70
Instructions:
(i) All questions are compulsory.
(ii) Programming language: Java, SQL
1. / a. / Ms. Rashmi is interested in transferring song. Suggest her two suitable wireless options which may use for doing the same.ANSWER :
Bluetooth and Infrared .
(1/2 marks for each correct answer any two) / 1
b. / It is technology on computer networks whose purpose is to prevent unwanted networking connection according to some filtering/blocking rules. What is it?
answer :
Firewall
(1 marks for correct answer ) / 1
c. / Which transmission technology can we use for connecting two countries over an ocean?
answer :
MAN (Metropolitan Area Network)
(1 marks for correct answer ) / 1
d. / Which type of server act as a workstation as well as server?
answer :
Non-Dedicated Server.
(1 marks for correct answer ) / 1
e. / Differentiate between HUB and SWITCH devices.
answer :
HUB : less speed compared switch. It share bandwidth for connected computers. It has half-duplex (bi-directional) communication.
SWITCH: more speed compared to HUB. It communicate at full bandwidth. It communicate two-way communication (full duplex).
(1 marks for each correct answer ) / 2
f. / Explain transliteration and keymap based text entry.
answer :
Transliteration : Words as per their pronunciation in English script and later converted to corresponding language word, is known as Phonetic Text Entry.
Keymap based Text Entry: The mapping of a characters are known as keymap based text entry. –
(1 marks for each correct answer ) / 2
g. / Identify the topologies used for the following.
(1) In it the nodes form a circular path for data to travel and each node is connected to two other nodes.
(2) Each node is connected on single transmission cable and data transmit from one end to other end.
answer :
1) Ring
2) Bus
(1 marks for each correct answer ) / 2
2. / (a) / Which statement is used to stop the loop before its maturity?
Ans: break
(1 mark for correct answer) / 1
(b) / How one can make a JButton disabled during runtime, so that it cannot be clicked?
Ans: JButton1.setEnabled(false);
(1 mark for correct answer) / 1
(c) / Write two name of empty category tag.
Ans: <br>, <hr>, <IMG> or any other
(1 mark for correct answer) / 1
(d) / Is the following XML code valid? Justify your answer.
<student-list>
<student>
<rollno> 123 </rollno>
<name> Ambika </name>
</student-list>
Ans: No, because student tag not closed as per XML
(1/2 marks for NO and 1/2 marks for valid reason) / 1
(e) / What will be the values of a and b after the following java code is executed:
int a = 10 , b= 8 ;
int i = a % b ;
switch ( i )
{
case 1 : a++ ; b++ ; break ;
case 2 : a++ ; - -b ;
case 3 : b++ ; - -a ;
}
Ans: a=10, b=8
((1 mark for each correct answer) / 2
(f) / Write code in java that takes two Strings from textfields t1 and textfields t2 and display them joined together in a third textfield t3.
Ans: String s1=t1.getText();
String s2=t2.getText();
t3.setText(s1+s2);
(1 mark for reading string 1 mark for joint and display string) / 2
(g) / Difference between GET and POST methods of <FORM> tag.
Ans:
GET- sends the form information to the URL specified through action attribute.
POST- sends the form information in the HTTP environment.
1 mark each for correct answer. / 2
3. / (a) / What is a key attribute?
Ans: The attribute which is used to uniquely identify a record in a relation is called key attribute.
(1 mark for correct answer) / 1
(b) / Differentiate between COMMIT and SAVEPOINT.
Ans:
S.No. / Commit / ROLLBACK
1 / End the Current Transaction / Undoes all the changes made
2 / No Rollback Allow after the commit / Complete rollback
(1 marks for each correct difference) / 2
(c) / What is the difference between COUNT (<column name>) and COUNT (*) command in MySQL?
Ans: COUNT (<column name>) count the number of values in the particular column without null values.
COUNT(*) count the number of rows in the table.
(1 marks of each correct answer) / 2
(d) / A table Employee in a database has 6 columns and 4 rows in it. After adding 3 more rows in the table What is it cardinality and degree?
Ans: Degree-6, Cardinality-7
(1/2 marks for each correct answer) / 1
(e) / Sunil decides to delete a PhoneNo column from a MySQL Table (student) after insert the data into the table. Write the command to delete that particular column in student table.
Ans: Alter Table student
Drop PhonoNo;
(1 mark for correct answer) / 1
(f) / Find out the error(s) in this MySQL query
SELECT * FROM EMPLOYEE WHERE CITY = NULL;
Ans: SELECT * FROM EMPLOYEE WHERE CITY IS NULL;
(1 mark for correct answer) / 1
(g) / On the basis of table EMPLOYEE find the answers for following questions.
Table:EMPLOYEE
Eid / Name / Deptid / Sex / Basic / HRA / Bonus
1 / RAMANI / 101 / F / 6000 / 2300 / 200
2 / RAJAT / 101 / M / 2000 / 300 / 30
3 / PREM / 102 / M / 1000 / 300 / 40
4 / MANOJ / 102 / M / 1500 / 490 / 30
5 / KIRAN / 103 / M / 8000 / 900 / 80
6 / RADHA / 101 / F / 10000 / 490 / 89
(i) SELECT MAX(Basic) FROM EMPLOYEE GROUP BY(Deptid);
Ans:
MAX(Basic)
10000
1500
8000
(ii)SELECT SUM(Bonus) FROM EMPLOYEE WHERE Sex= ‘M’;
Ans:
SUM(Bonus)
180
(1 mark for each correct answer) / 2
4 / (a) / Write any one difference between an abstract class and a simple class.
Ans: An abstract class is a class that represents just a concept. Therefore, it is not possible to create the objects of an abstract class But simple class object can be create.
(1 mark for correct answer) / 1
(b) / What will be the content of jTextArea1 after executing the following statement? 1
jTextArea1.setText(“1234”.length( )+1+ “ ” );
Ans: 5
(1 mark for correct answer) / 1
(c) / Assuming rs is the ResultSet object being loaded with the query result, write a statement in java to move the ResultSet cursor to the last record.
Ans: rs.last();
(1 mark for correct answer) / 1
(d) / Rewrite the following code using if-else:
boolean flag = Boolean.parseBoolean( bolTF.getText( ) ) ;
switch ( flag )
{ case true : System.out.println( "true" ) ;
break ;
case false: System.out.println( "false" ) ;
}
Ans: boolean flag = Boolean.parseBoolean( bolTF.getText( ) ) ;
if(flag)
System.out.println( "true" ) ;
else
System.out.println( "false" ) ;
(1 mark for correct if statement 1 mark for correct else statement) / 2
(e) / Predict the value of C and D if they are of Boolean types
if a and b are integers with values a=38 and b= - 10 then
C=(a>30)&(b>-20);
D=!((a<22)||(a>10));
Ans: C=true
D=false
(1 mark for each correct answer) / 2
(f) / The following code has some error(s). Rewrite the correct code underlining all the correction made:
i=Integer.parseInt(atxt.getText( ));
if(i=0)
{
do while(i<10)
{
system.out.println(i++);
i+=1;
}
}
Ans: int i=Integer.parseInt(atxt.getText( ));
if(i==0)
{
do
{
System.out.println(i++);
i+=1;
} while(i<j);
}
(½ marks for each error, any four) / 2
(g) / The following GUI form is created in Netbeans for a Book Store where customers are given discount as follows:
Book Type / Discount %
Magazine / 2%
General / 3%
CBSE / 4%
An additional discount of 2% is given if the total amount exceeds 1999.(refer GUI diagram)
Now answer the following:
i) Write java code for Calculate Total button (calcTotalBTN) which calculates total amount from priceTF and qtyTF and display the total value in totalTF.
ii) Write java code for Calculate Discount % button (calcDiscPerBTN) which determines the discount percentage as per the given criteria and display the discount percentage in the discPerTF textfield.
iii) Write java code for Calculate Net Amount button (calcNetAmtBTN) which calculates the net amount by reducing the discount amount from total and display the net amount in the netAmtTF textfield.
Ans:
i) float price = Float.parseFloat( priceTF.getText( ) ) ;
float qty = Float.parseFloat( qtyTF.getText( ) ) ;
float total = price * qty ; (1/2 Mark)
totalTF.setText( total + "" ) ; (1/2 Mark)
ii) int discount = 0;
if( magRB.isSelected( ) )
discount = 2 ;
else if( genRB.isSelected( ) )
discount = 3 ;
else
discount = 4 ; (1& 1/2 Mark for deciding discount as per criteria)
float total = Float.parseFloat( totalTF.getText( ) ) ;
if( total > 1999 )
discount += 2 ; (1 Mark for doing additional discount)
discPerTF.setText( discount + "" ) ; (1/2 Mark for displaying)
iii) float amt = Float.parseFloat( totalTF.getText( ) ) ;
float discper = Float.parseFloat( discPerTF.getText( ) ) ;
float disc = amt * discper / 100 ; (1 Mark )
float net = amt - disc ; (1/2 Mark )
netAmtTF.setText( net + "" ) ; (1/2 Mark) / 6
5. / (a) / Discuss the role of Foreign Key Constraints in MySQL table.
Ans:
(i) It results into the rejection of Insert or update if a corresponding value does not currently exist in the primary table.
(ii) The foreign key column in the child table must reference a primary key or unique column in the parent table.
(iii) Both the related tables’ column should have the same data type.
(1 marks for each point any two) / 2
(b) / Write the output of the following MySQL statements :
(i) SELECT CHAR(48) as ‘Char’;
Ans:
Char(48)
0
(ii) SELECT MID(‘KENDRIYA VIDYALAYA',4,7) ;
Ans: DRIYA V
(iii) SELECT YEAR(‘2014-12-14’)+5;
Ans: 2019
(iv) SELECT TRUNCATE (SQRT(1000),1);
Ans: 36.1
(1/2 mark for each correct answer) / 2
(c) / Write MySQL commands for the statement (i) to (iv) and give outputs for MySQL queries (v) to (viii) on basis of the table LAB.
ItemName / CostPerItem / Quantity / DateOFPurchase / Warranty / Operational
Computer / 60000 / 9 / 21/05/2006 / 2 / 7
Printer / 15000 / 3 / 21/02/2007 / 4 / 2
Scanner / 18000 / 1 / 29/08/2008 / 3 / 1
Camera / 21000 / 2 / 13/06/2006 / 1 / 2
Hub / 8000 / 1 / 31/10/2009 / 2 / 1
UPS / 4000 / 5 / 21/05/2006 / 1 / 4
Plotter / 15000 / 2 / 11/01/2010 / 2 / 2
(i) Select the item name and cost of items purchased after 31/01/2007. (1)
Ans: SELECT ItemName,costPerItem FROM LAB WHERE DateOFPurchase> ‘31/01/2007’;
(ii) To list item name in descending order of the date of purchase where quantity is more than 3. (1)
Ans: SELECT ItemName FROM LAB WHERE Quantity>3 ORDER BY DateOFPurchase DESC;
(iii) To display the difference between Maximum and Minimum CostPerItem. (1)
Ans: SELECT MAX(CostPerItem) – MIN(CostPerItem) FROM LAB;
(iv) To display a report showing ItemName, CostPerItem, Warranty and SellingPrice (15% of CostPerItem) for all the Lab Items. (1)
Ans: SELECT ItemName, CostPerItem, Warranty, CostPerItem*0.15 AS “SellingPrice” FROM LAB;
(v) SELECT MIN (Quantity) FROM LAB WHERE CostPerItem <15000. (1/2)
Ans: 1
(vi) SELECT COUNT (*),Warranty FROM LAB GROUP BY Warranty desc. (1/2)
Ans:
COUNT(*) / Warranty
2 / 1
3 / 2
1 / 3
1 / 4
(vii) SELECT SUM (DISTINCT CostPerItem) FROM LAB. (1/2)
Ans: 126000
(viii) SELECT AVG (CostPerItem) FROM LAB WHERE DateOFPurchase< ‘01-01-2009’. (1/2)
Ans: 23600 / 6
6. / (a) / Write MySQL commands to create the table HOSPITAL with following specification:
Field Name / Data Type / Constraints
Did / Int(4) / Part of primary key
PNo / Int(4) / Part of primary key
Age / Int(2) / <=16
Department / Varchar(20) / Not Null
DateOfAdm / Date
Charges / Double(7,2)
Address / Varchar(15) / Default Hyderabad
Ans: CREATE TABLE HOSPITAL(
Did int(4),
PNo int(4),
Age int(2) CHECK(Age<=16),
Department varchar(20) NOT Null,
DateOfAdm date,
Charges double(7,2),
Address varchar(15) DEFAULT ‘Hyderabad’,
PRIMARY KEY (Did, PNo));
(2 marks for correct answer cut the marks for partially correct answer) / 2
(b) / In database there are two tables “Student” and “Stream” as below :
Table: Student
Sid / Sname / Age / StrId
1 / Roondy / 10 / 1
2 / Joseph / 12 / 1
3 / Trinchu / 14 / 2
4 / Prithlon / 11 / 3
5 / Ahol / 10 / 2
Table: Stream
StrId / Name
1 / Eng
2 / Com
3 / Sci
4 / Hum
(i) What is the cardinality and degree of both tables?
Ans:
First Table / Second Table
Cardinality / 5 / 4
Degree / 4 / 2
(1 mark for correct answer)
(ii) In both tables which tables has the foreign key and write the foreign key name.
Ans: Student Table has the foreign key and Strld work as a foreign key.
(1 mark for correct answer) / 2
(c) / Consider the following tables Product and Client. Write MySQL commands for the statement (i) to (iv) and give outputs for SQL queries (v) to (viii).
Table: Product
P_ID / ProductName / Manufacturer / Price
TP01 / Talcom Powder / LAK / 40
FW05 / Face Wash / ABC / 45
BS01 / Bath Soap / ABC / 55
SH06 / Shampoo / XYZ / 120
FW12 / Face Wash / XYZ / 95
Table:Client
C_ID / ClientName / City / P_ID
01 / Cosmetic Shop / Delhi / FW05
06 / Total Health / Mumbai / BS01
12 / Live Life / Delhi / SH06
15 / Pretty Woman / Delhi / FW12
16 / Dreams / Bangalore / TP01
(i) To display the details of those Clients whose City is Delhi. (1)
Ans: SELECT * FROM Client WHERE City = ‘Delhi’;
(ii) To Display the details of Products whose Price is in the range of 50 to 100(Both values included). (1)
Ans: SELECT * FROM Product WHERE Price BETWEEN 50 AND 100;
(iii) To Display the ClientName, City from table Client and ProductName and Price from table Product, with their corresponding matching P_ID. (1)
Ans: SELECT ClientName, City, ProductName, Price FROM Product, Client WHERE Product.P_ID=Client.P_ID;
(iv) To increase the Price of all Products by 10. (1)
Ans: UPDATE Product SET Price=Price+10;
(v) SELECT DISTINCT (City) FROM Client; (1/2)
Ans: 3
(vi) SELECT Manufacturer, MAX(Price), MIN(Price), COUNT(*) (1/2)
FROM Product GROUP BY Manufacturer;
Ans:
Manufacturer / MAX(Price) / MIN(Price) / COUNT(*)
LAK / 40 / 40 / 1
ABC / 55 / 45 / 2
XYZ / 120 / 95 / 2
(vii) SELECT ClientName, Manufacturer FROM Product, Client (1/2)
WHERE Client.P_ID=Product.P_ID;
Ans:
ClientName / Manufacturer
Cosmetic Shop / ABC
Total Health / ABC
Live Life / XYZ
Pretty Woman / XYZ
Dream / LAK
(viii) SELECT ProductName, Price*4 FROM Product; (1/2)
Ans:
ProductName / Price*4
Talcom Powder / 160
Face Wash / 180
Bath Soap / 220
Shampoo / 480
Face Wash / 380
/ 6
7 / a. / How is e-learning beneficial to students ? Write one point.
answer :
Student can learn their own pace.
Students can learn lessons at their homes at their convenient time.
A lesson can be revised any number of times at students’ convenience.
(1 mark for correct answer) / 1
b. / What is the significance of a good GUI?
answer :
A good GUI design is an important feature for a software’s success and acceptance. if the end users find the software to be too cumbersome or difficult to understand, then the software may be rejected even if it is an excellent software product.
(2 mark for correct answer) / 2
c. / Parikshit 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, Check box, List box, Combo box, Button and write in the third column.
S. No. / Control used to / Control
1 / Enter Admission number
2 / Select Stream
3 / Select Subject
4 / Clear the Form
answer :
1. text field
2. list box/ combo box/radio button
3. check box
4. button
(1/2 mark for each correct answer) / 2
Page 1 of 11