2017 12 SP Informatics Practices 2
2017 12 SP Informatics Practices 2
2017 12 SP Informatics Practices 2
1. (a) After realizing the issues with proprietary software, Ms. Sunita has decided to use
only Open Source Software. Suggest any one suitable open source software to her, for
each of the following categories: (1)
i. Operating System
ii. Browser
i. ODF
ii. PPP
(d) How a Phonetic text entry is different from Keymap based text entry? (1)
iii. If Martina installs some receiver hardware to capture the data while on its way.
iv. If Kim gets someone’s login information by casually watching what he/she is typing.
i. Option i only
(f) It’s an era of networking! Almost everyone and everything is connected through one
way or the other, hats off to the technology. We have never been so much linked as we
are today. (4)
Daniel has just started his hands-on practice of networking. Help him in the following:
I. He has just connected 10 computers of his resource room to establish a network. Name the
network (LAN/MAN/PAN/WAN) which will be formed. Mention any two main benefits which
Daniel could achieve by establishing a network.
II. Help him in identifying the correct topology which has following characteristics:
Depict the topology by drawing the diagram showing 4 interconnected computers through
central hub/switch.
Ans. (a) i. Linux or Google Chrome OS or any other open source OS
ii. Mozilla Firefox or Google Chrome or any other open source browser
(c) Domain Name Resolution is the process of getting corresponding IP address from a
domain name.
(d) Phonetic text entry is different from keymap based text entry as in the keymap based text
(f) i. LAN
Benefits of Networking:
Resource sharing
Cost saving
I. She wants to compare two integer values for equality in her java code. Out of (=) and (= =),
which operator she should use and why?
II. Help her in writing Java code to initialize two integer variables named num1 and num2
with values 5 and 10 respectively. Increase the value of num1 by 5 and decrease the value of
num2 by 5.
(b) Mr. Sahil, a programmer in a VISA processing company, has written the following
code (2)
int ch=Integer.parseInt(jTextField1.getText());
switch(ch)
case 1:
case 2:
case 3:
case 4:
default:
jTextField2.setText(“Invalid Entry”);
(c) Realizing the importance of the Internet, Ms. Shikha a Mathematics teacher, has decided
to use Internet as a medium to teach her students Mathematics in an interesting way. (4)
I. She wants to design a webpage as shown below to create a mathematics tutorial on the
topic “Shapes” using HTML.
She has written following HTML code for the same but she is not getting the desired output.
Help her in identifying the error(s) and suggest the suitable corrections:
<html>
<head><title>Shapes</title></head>
<body>
<table>
<tr>
<tr>
<td>Shapes</td>
<td>Images</td>
</tr>
<tr>
<td>Circle</td>
<td><img source=“circle.jpg”></td>
</tr>
<tr>
<td>Square</td>
</tr>
</table>
</body>
</html>
II. Help her in matching Column A with suitable statements of Column ‘B’
Column A Column B
As = operator is assignment operator which will be used to assign the values to any
variable/constant while = = is comparison operator for equality.
num1=num1+5;
num2=num2-5;
(b) In absence of break ‘fall through’ condition occurs. As a result, control, will not be able to
come out of the switch block after first matching. So, all the messages will be overwritten by
the last message i.e. “Invalid Entry” due to set Text () method.
(c) <html>
<head><title>Shapes</title></head>
<body>
<tr>
</tr>
<tr>
<td>Shapes</td>
<td>Images</td>
</tr>
<tr>
<td>Circle</td>
</tr>
<tr>
</tr>
</table>
/body>
</html>
II.
Column A Column B
XML Elements must have a closing tag.
It is designed to store and transport
XML
data
HTML
3. (a) In today’s digitized world with a need to store data electronically, it is very
important to store the data in the databases. SQL is used to interact with the Database
Management System. (4)
i. INSERT INTO
II. Which clause would you use with Select to achieve the following:
i. To select the values that match with any value in a list of specified values.
III. Chhavi has created a table named Orders, she has been asked to increase the value
of a column named sales amount by 20. She has written the following query for the
same.
(b) I. Name any one Single row function and any one Aggregate function. Also, mention
the difference in their working. (4)
II. Explain why the following queries give different outputs on execution:
II. a. IN
b. Distinct
III. No, alter command is used to make changes to the structure of the table, but Chhavi has
to make changes in the data stored in the table. Hence, she should write the following query:
A single row functions works on every row of the table and hence gives output for each row
in the table.
An Aggregate function also known as Multiple row function works on a group of rows and
returns only 1 output.
(1 Mark for the writing any 1 valid Single row and Aggregate function)
II. Aggregate functions ignore NULL values. The first query counts the Not Null values in the
column ENAME hence the output is 5.
Hence this implies that there are 8 rows in the table and the Ename column contains the
name of only 5 employees. 8-5 = 3, i.e. 3 names have been left blank.
This means that there are 3 null values in the column ENAME.
(2 Marks for giving individual explanation of the queries along with the reason for
difference in the output)
(c) A table in MYSQL is created using CREATE TABLE command which is a DDL command. A
DDL command cannot be rolled back hence she needs to use the DROP TABLE command to
remove the table.
4. (a) Ms. Meena is not able to understand the statement “Java is a case sensitive
language”. Help her in understanding the above-mentioned statement by giving
suitable example. (1)
(b) Ms. Rachel is designing a frame in NetBeans in which she has used four Radio Button
controls. She wants that only one radio button out of four should be selected at a time.
Which property of the Radio Button should be selected to achieve the same? (1)
(c) What will be displayed in jTextArea1 after the following code is executed: (1)
int i;
for(i=10;i<50; i=i+30)
i=i+15;
jTextArea1.append(""+i);
jTextArea1.append("\n"+i);
I. Find the output of the following Java code snippet after execution of each java statement
labelled as Stmt 1, Stmt 2, Stmt 3, Stmt 4:
String str1="VASUDHAIVA",str2="KUTUMBAKAM";
jTextArea1.append((str1.substring(0,4))); //Stmt 1
jTextArea1.append((str2.substring(4))); //Stmt 2
int num=Integer.parseInt(jTextField1.getText());
while(num<=40)
jOptionPane1.showMessageDialog(null, num);
num=num*20;
(e) The following code has error(s). Rewrite the correct code underlining all
value1=1, value2=2;
while(value1<value2)
jTextArea1.append ("\n"+value1*value2;
value1++
(f) Mr. Ashish works as a programmer in “Universal Technologies Pvt. Ltd.”. He has
designed a Library software to generate the member ship fee depending upon the
membership type considering discount eligibility as well. A screenshot of the same is
shown below: (6)
Monthly 500
Quarterly 1000
Yearly 1500
ii. After selecting appropriate Radio Button, when ‘Check Discount’ button is clicked,
appropriate discount should be displayed in the respective text field according to the
following criteria:
iii. When ‘Calculate’ button is clicked, Net Fee should be calculated and displayed in the
respective text field as per the given formula:
iv. When ‘Clear All’ button is clicked, All the text fields should be cleared.
Ans. (a) Java is a case sensitive language as java distinguish between uppercase
and lowercase very strictly. For example:
Although both variable have same name in the above statement but java will treat them two
different variables due to first character in different case.
(c). 25
(d) I. VASU
VASUMBAKAM
VASUMBAKAM10
12
do
jOptionPane1.showMessageDialog(null, num);
num=num*20;
} while(num<=40);
jOptionPane1.showMessageDialog(null,"Bye Bye");
while(value1<value2)
value1++; //Correction 4
if (jRadioButton1.isSelected())
jTextField3.setText("500");
else if (jRadioButton2.isSelected())
jTextField3.setText("1000");
else if (jRadioButton3.isSelected())
jTextField3.setText("1500");
if (jRadioButton4.isSelected())
jTextField4.setText("200");
else if (jRadioButton5.isSelected())
jTextField4.setText("100");
int fee=Integer.parseInt(jTextField3.getText());
int disc=Integer.parseInt(jTextField4.getText());
int net=fee-disc;
jTextField5.setText(""+net);
jTextField2.setText("");
jTextField3.setText("");
jTextField4.setText("");
jTextField5.setText("");
(c) Observe the given table carefully and answer the following questions: (2)
i. Name the column that might have a Primary Key constraint. Justify your answer.
ii. Name the column that might have a Unique constraint. Justify your answer.
Table: Pharma DB
Rx Pitampura, Delhi
R1000 5476 Amlodipine 100.00
Pharmacy
Raj
R1001 2345 Paracetamol 15.00 Bahadurgarh, Haryana
Medicos
MyChemist Rajouri
R1002 1236 Nebistar 60.00 MyChemist
Garden, Delhi
Gurgaon, Haryana
R1003 6512 VitaPlus 150.00 MyChemist
R1004 5631 Levocetirizine 110.00 RxPharmacy South Extension, Delhi
ii. To display all those medicines whose price is in the range 100 to 150.
iv. To display the Drug ID, Drug Name and Pharmacy Name of all the records in descending
order of their price.
(e) On the basis of the Table Pharma, write the output(s) produced by executing the
following queries: (2)
i. SELECT RxID, DrugName, Price from PharmaDB where PharmacyName IN (“Rx Parmacy”,
“Raj Medicos”);
(b) No, it’s not the same as null means a value that is unavailable, unassigned or unknown
and zero is a defined value.
(c) 1. PanNo must be a Primary Key as it contains unique and NOT NULL values.
2. Phone no must have a Unique constraint as it contains non-repeating values and a Unique
constraint allows NULL values.
(1 Mark each for correct identification of the column and the correct reason.)
ii. Select * from PharmaDB where price between 100 and 150;
iii. Select Max(Price) from PharmaDB where Pharmacy Location like” % Gurgaon%”;
iv. Select Drug ID, DrugName, PharmacyName from PharmaDB order by Price desc;
(e) i.
Rx Pharmacy | 2
Raj Medicos | 1
My Chemist | 2
6. (a) Write SQL query to create a table “Job” with the following structure: (2)
Table: Job
(b) Consider the tables given below which are linked with each other and maintains
referential integrity: (6)
Table: SAP
Table: Store
With reference to the above given tables, write commands in SQL for (i) and (ii) and output
for (iii) below:
i. To display the ItemCode, ItemName and Received Date of all the items
ii. To display SAPID, ItemName, ItemStorageLocation of all the items whose Received date is
after 2nd May 2016.
(c) What will be the degree and cardinality of the Cartesian product formed while
combining both the above given tables ‘SAP’ and ‘Store’? (1)
(d) Sangeeta is not able to add a new record in the table ‘Store’ through the following
query: (1)
J_Lastupdate Date);
iii.
ItemName StoreID
SAPID
1201
S1001 Receiver
(c) Degree: 8
Cardinality: 25
(d) As referential integrity is being maintained in between both the tables, Item Code 1006
cannot be inserted in the table store as there is no corresponding matching entry in the table
SAP.
7. (a) Observe the given domains carefully and identify the category it belongs out of
eGovernance/e-Business/e-Learning: (1)
i. AMAZON: www.amazon.in
(b) Mention any one social and economic benefit of ICT. (2)
(c) Ms. Rachna, works as a programmer in ‘Plan My Trip’ travel company. She wishes to
design a Flight booking page. Help her in choosing appropriate controls for the
specified task from Text field, Label, Radio button, Check box, List box, Combo box,
Button and write in the third column. (2)
Ans.(a) i. e- Business
i. Social networking sites help people to stay in touch with their near and dear ones.
Economic Benefit:
i. It helps economy grow at faster rate as it provides transparency in the process and
increases accountability.
(c)