eworksheet - e-worksheet - worksheet for cbse and … practices-signed.pdfpage 1 of 5 xii...

5
Page 1 of 5 XII INFORMATICS PRACTICES CBSE Board – 2015 [Time allowed: 3hours] [Maximum Marks: 70] Instructions (i) All questions are compulsory (ii) Programming Language: Java 1. (a) A school with 20 stand-alone computers is considering networking them together and adding a server. State 2 advantages of doing this. (b) Distinguish between LAN and WAN. (c) What is the purpose of Modem in network? (d) Write one example of IP Address. (e) Define ‘Domain Name Resolution’. . (f) Name two threats to security in a network. What is the role of Firewall in Network security? - (g) The students of “Shiksha Vidyalaya” work for different extracurricular activities like ‘Community Outreach Programme’, ‘Swachh Bharat Abhiyan’ and ‘Traffic Safety Club’. The Programmer at the school has developed a GUI application as shown below : A student can participate in more than one activities. Each student gets 10 points for each activity — namely Community Outreach Programme, Swachh Bharat Abhiyan and Traffic Safety Club. Help the programmer to write code for the following: (i) When ‘Calculate Total Score’ button is clicked, the points for each activity (that is selected) should be displayed in the text field in front of that activity’s checkbox and the Total Score should be displayed in the appropriate Text field. (ii) When Clear button is clicked, all the Textfields and Checkboxes should be cleared. (iii) When Stop button is clicked, the application should close. eworksheet.org eworksheet.org eworksheet.org eworksheet.org eworksheet.org

Upload: truongthu

Post on 30-May-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1 of 5

XII INFORMATICS PRACTICESCBSE Board – 2015

[Time allowed: 3hours] [Maximum Marks: 70]Instructions (i) All questions are compulsory

(ii) Programming Language: Java

1. (a) A school with 20 stand-alone computers is considering networking them together and adding a server. State 2advantages of doing this.

(b) Distinguish between LAN and WAN.

(c) What is the purpose of Modem in network?

(d) Write one example of IP Address.

(e) Define ‘Domain Name Resolution’.

.(f) Name two threats to security in a network. What is the role of Firewall in Network security?

-

(g) The students of “Shiksha Vidyalaya” work for different extracurricular activities like ‘Community OutreachProgramme’, ‘Swachh Bharat Abhiyan’ and ‘Traffic Safety Club’. The Programmer at the school has developed aGUI application as shown below :

A student can participate in more than one activities. Each student gets 10 points for each activity — namely

Community Outreach Programme, Swachh Bharat Abhiyan and Traffic Safety Club.Help the programmer to write code for the following:

(i) When ‘Calculate Total Score’ button is clicked, the points for each activity (that is selected) should bedisplayed in the text field in front of that activity’s checkbox and the Total Score should be displayed in theappropriate Text field.(ii) When Clear button is clicked, all the Textfields and Checkboxes should be cleared.(iii) When Stop button is clicked, the application should close.

eworksheet.org

eworksheet.org

eworksheet.org

eworksheet.org

eworksheet.org

Page 2 of 5

-

Consider the following table named “SOFTDRINK”. Write commands of SQL for (i) to (iv) and output for (v) to(vii).

Table : SOFTDRINKDRINKC ODE DNAME PRICE CALORIES101 Lime and Lemon 20.00 120102 Apple Drink 18.00 120103 Nature Nectar 15.00 115104 Green Mango 15.00 140105 Aam Panna 20.00 135106 Mango Juice Bahaar 12.00 150

(i) To display names and drink codes of those drinks that have more than 120 calories.(ii) To display drink codes, names and calories of all drinks, in descending order of calories.(iii) To display names and price of drinks that have price in the range 12 to 18 (both 12 and 18 included).(iv) Increase the price of all drinks in the given table by 10%.(v) SELECT COUNT (DISTINCT (PRICE) ) FROM SOFTDRINK;(vi) SELECT MAX (CALORIES) FROM SOFTDRINK;(vii) SELECT DNAME FROM SOFTDRINK WHERE DNAME LIKE “%Mango%”

( )h

(i) Mr. Rangaswami works at a Recreation Park as a system analyst. He has created the following GUI.when a group arrives at the Recreation Park, the number of people in the group and whether the groupwants to enjoy the Water park or not is entered. Entry fees is Rs. 500 per person. The person can choose toplay at Water Park by selecting the checkbox. Rides of Water Park will cost Rs. 250 extra per person.

Help him to write code for the following:(i) On the click of command button ‘Calculate’, textfield for ‘Entry Fees’ should display Entry Fees per

person x Number of people.If ‘Water park’ checkbox is selected, textfield for ‘Water Park Charges’ should display Water ParkCharges per person x Number of people. Textfield for ‘Total Amount’ should display sum of EntryFees and Water Park Charges for all the people in the group.

(ii) Write Java code to clear all Textboxes on the click of ‘Clear’ button. (iii) Write Java code to close the application on the click of ‘Exit’ button.

(j) What is the difference between “%” and “_” wild card characters with reference to LIKE clause of MySQL?(k) Name a function of MySQL used to give the first occurrence of a string2 in string1.(l) Consider the following table named “EXAM” with details of marks. Write commands of MySQL for (i) to (iv)

and output for (v) to (vii).

(i) To display all information of the students of humanities in descending order of percentage.(ii) To display Adno, Name, Percentage and Stream of those students whose name is less than 6 characters

long.(iii) To add another column Bus_Fees with datatype and size as Decimal (8, 2).(iv) To increase percentage by 2% of all the Humanities students.(v) SELECT COUNT (*) FROM Exam;(vi) SELECT SName, Percentage FROM EXAM WHERE Name LIKE “N%”;(vii)SELECT ROUND (Percentage, 0) FROM EXAM WHERE Adno=”R005”;

eworksheet.org

eworksheet.org

(m) Write MySQL command to create the table “Toyz” with the following structure and constraint.

Page 3 of 5

eworksheet.org

eworksheet.org

Answers :-

Ans Sharing of resources such as printers and scanners can be possible.Can share data and access file from any 20 machines.

(a)

Ans In LAN communication devices interconnected within ageographically limited area, such as a building or acampus.

In WAN network spread across countries withoutany limits of distance for this satellites are used.

(b)

Ans The purpose of Modem in network is to produce a signal that can be transmitted easily and decoded toreproduce the original digital data over network.

(c)

Ans 127.0.0.1(d)

Ans Domain Name Resolution is the task of converting domain names to their corresponding IP address. Webbrowsers issue command the operating system for resolving the domain name into its IP addressto

Ans Snooping & Eavesdropping are examples of threats to security in a network. A firewall is a network securitysystem, either hardware- or software based, that controls incoming and outgoing network traffic based on aset of rules.

(e)

Ans

ii

iii

Calculate Total Score button -COP.setText("0");SBA.setText("0");TSC.setText("0");if(COPBox.isSelected()==true)

COP.setText("10");if(SBABox.isSelected()==true)

SBA.setText("10");if(TSCBox.isSelected()==true)

TSC.setText("10");inttotaler.parseInt(TSC.getText());TS.setText(Integer.toString(total));Clear button -COP.setText(null);SBA.setText(null);TSC.setText(null);COPBox.setSelected(false);SBABox.setSelected(false);TSCBox.setSelected(false);

Stop button -System.exit(0);

(f)

(g)

i

Ans (i) SELECT DNAME,DRINKCODE FROM SOFTDRINK WHERE CALORIES>120;

(ii) SELECT DRINKCODE ,DNAME, CALORIES FROM SOFTDRINK ORDER BY CALORIES DESC;

(iii) SELECT DNAME,PRICE FROM SOFTDRINK WHERE PRICE BETWEEN 12 AND 18;

(iv) UPDATE SOFTDRINK SET PRICE=PRICE+(PRICE*10/100);

(v) 4

(vi) 150

(vii) Mango Juice Bahaar

iii

(h)

Page of 54

eworksheet.org

eworksheet.org

eworksheet.org

Ans.(i) //calculate buttonint p=Integer.parseInt(jTextField1.getText());

int a=Integer.parseInt(jTextField2.getText());int e=Integer.parseInt(jTextField3.getText());int person_charges=p*a;int water_charges=p*e;int total=person_charges+water_charges;jTextField4.setText(Integer.toString(total));

//check boxif(jCheckBox1.isSelected()==true)

{jTextField3.setText("250");

}(ii) //clear

jTextField1.setText("");jTextField2.setText("");jTextField3.setText("");

jCheckBox1.setSelected(false);(iii) //Exit

System.exit(0);

Ans. The ‘%’ character matches any substring whereas the ‘_’ character matches any character.( j )

Ans. Instr()( k )

Ans.( l ) (i) SELECT * FROM EXAM WHERE Stream LIKE ‘Humanities’ ORDER BY Percentage DESC;(ii) SELECT Adno, Sname, Percentage, Stream FROM EXAM WHERE Sname LIKE '_____';(iii) ALTER TABLE EXAM ADD (Bus_Fees DECIMAL(8, 2));(iv) UPDATE EXAM SET PERCENTAGE=Percentage+(Percentage*2/100) WHERE Stream LIKE 'Humanities'(v) COUNT(*)

5

(vi) Sname PerentageNiara 96.0

(vii)ROUND(Percentage,0)89

Ans. CREATE TABLE TOYZ(TOY_NO INTEGER(10) PRIMARY KEY, TOY_NAME VARCHAR(20), TYPE CHAR(10), PRICE

DECIMAL(8, 2), COLOUR VARCHAR(15));

( m )

Page 5 of 5

eworksheet.org

eworksheet.org

eworksheet.org

eworksheet.org