Professional Documents
Culture Documents
Cbse QP Sol 2011
Cbse QP Sol 2011
(e) Mr. Vidya Chauhan is confused between Proprietary and Open source software. Mention 2
at least two points of differences to help her understand the same.
Ans.
Proprietary software Open Source software
Has to be paid for Free and therefore need not be paid for
Source code not available Source code available for change
Cannot be copied / distributed Can be copied and distributed
(f) Identify the type of topology from the following: 2
(i) In it, each node is connected with the help of a single co-axial cable.
Ans. Bus Topology
(ii) In it, each node is connected with the help of independent cable with the help of a central
switching (communication controller).
Ans: Star Topology
(g) Define the following with reference to Threats to network security. 2
(i) Worm
(ii) Trojan Horse
Ans. (i) Worm :
Self-replicating malware without user intervention
Consumes high volume of bandwidth leading to Denial of service (DoS)
(ii) Trojan Horse
Appears to perform a desirable function for the user
Steals information through a 'backdoor' /Records browsing activities
without the knowledge of the user
Causes system crash or freeze
2(a) While working in Netbeans, Ms. Khorana wants to display ‘Pass’ or ‘Needs to Reappear’ message 1
depending the marks entered in jTextField. Help her to choose more appropriate statement out
of ‘If statement’ and ‘Switch statement’.
Ans. IF statement
(b) How one can make a Text Field un-editable on a Frame? 1
Ans. <JTextField>.setEditable (false)
(c) Which HTML tags are used for making a table and adding rows in a HTML document? 1
Ans. <TABLE> </TABLE> tags are used for making a table.
<TR> </TR> are used for adding rows in a HTML document.
(d) How is <OL> tag different from <UL> tag of HTML? 1
Ans. <OL> stands for ordered list. This tag is used to display an ordered/ numbered list.
<UL> stands for unordered list. This tag is used to display a bulleted list.
(e) What will be the value of P and Q after execution of the following 2
code: int P,Q=100;
for(P=10;P<=12;P++)
{
Q+=P;
}
JOptionPane.showMessageDialog(this, ”P:” + P + ”Q:” + Q + ””);
Ans. P:13 Q:133
(f) Differentiate between XML and HTML. 2
Ans.
XML HTML
Defines, stores and retrieves the data Defines how webpage is displayed
XML tags are not predefined HTML tags are predefined
New tags can be created as per need New tags cannot be defined
XML tags must have a closing tag. HTML tags may not have closing tag
XML tags are case-sensitive. HTML tags are not case-sensitive.
(g) Write java code that takes the cost of a pencil from jTextField1 and number of pencil 2
from jTextField2 and calculate total amount as cost*number to be displayed in
jTextField3 and 20% service tax out of total amount in jTextField4.
Ans. double cost=Double.parseDouble(jTextField1.getText());
int n = Integer.parseInt(jTextField2.getText());
double amount=cost * n; jTextField4.setText(Double.toString(amount));
jTextField5.setText (Double.toString(amount * 0.20));
3(a) Write MySql command that will be used to open an already existing database “CONTACTS”. 1
Ans. USE CONTACTS;
(b) The Doc_name Column of a table Hospital is given below: 2
If the bill amount is more than Rs. 25,000/- then the customer gets an additional offer of
5%. Write java code for the following:
To assign Additional Discount as 0 (jTextField4) and Net amount as 0 (jTextField5). Also set
i) them as un-editable. (1)
ii) [when “Calculate Discount” (jButton1) is clicked]
To calculate discount as per the given criteria and display the same in jTextField3 1
To assign Additional Discount (jTextField4) as 5% of amount (jTextField2) as per the above 2
condition.
iii) To enable “Calculate Net Amount” (jButton2) button
[when “Calculate Net Amount” (jButton2) button is clicked]
To calculate net amount as [TotalCost(jTextField2)- Discount (jTextField3)
2
-Additional Discount (jTextField4)]
To display the net amount in jTextField5.
Ans: (i) jTextField4.setText("0");
jTextField5.setText("0");
jTextField4.setEditable(false);
jTextField5. setEditable(false);
(ii) double discount = 0.0 ;
double billAmount=Double.parseDouble(jTextField2.getText());
if(jRadioButton1.isSelected())
discount = 0.20;
if(jRadioButton2.isSelected())
discount = 0.15;
if (jRadioButton3.isSelected())
discount = 0 .10;
jTextField3.setText(billAmount * discount + “”) ;
if (billAmount > 25000)
jTextField4.setText (billAmount*0.05+“ ”);
jButton2.setEnabled(true) ;
(iii) doube netAmount = Double.parseDouble(jTextField2.getText()) -
Double.parseDouble(jTextField3.getText()) -
Double.parseDouble(jTextField4.getText());
jTextField5.setText(netAmount + " ");
5(a) What is the purpose of ALTR TABLE command in MySql? How is it different from UPDATE 2
command?
Ans: ALTER TABLE command is used to modify the structure of a table.
i To list the names of those students, who have obtained Division as FIRST in the ascending 1
ii order of NAME. 1
To display a report listing NAME, SUBJECT and Annual stipend received assuming that the
iii stipend column has monthly stipend. 1
iv To count the number of students, who have either accounts or 1
informatics as subject. To insert a new row in the table EXAM: 1
v 6,”Mohan”,500,”English”,73,”S 1
vi econd” SELECT AVG(Stipend) FROM EXAM 1
vii WHERE DIVISION=”THIRD” SELECT
Ans: CREATE TABLE BANK (Acct_number INTEGER (4) PRIMARY KEY, Name VARCHAR(3) ,
BirthDate DATE, Balance INTEGER ( 8 ) NOT NULL);
(b) In a database there are two tables “ITEM” and “CUSTOMER” as shown below: 5
Ans: (i) SELECT * FROM ITEM WHERE PRICE >= 40 AND PRICE <= 95;
(ii) SELECT CUSTOMERNAME, CITY, ITEMNAME, PRICE FROM CUSTOMER CUST,
ITEM WHERE CUST.ID = ITEM.ID;
(iii) UPDATE ITEM SET PRICE = PRICE + 50 ;
(c) In a database School there are two tables Employee and Dept as show below. 2