Vous êtes sur la page 1sur 6

NAVODAYA VIDYALAYA SAMITI

SUBJECT: INFORMATICS PRACTICES (Java)


Time: 03:00Hrs Class-XII Max Marks: 70
PRE-BOARD EXAMINATION-I (2019-20)

General Instructions:

 All questions are compulsory


 Question paper contains total 6 pages.

Answer the following questions:


1 a) Identify the odd one out of the following: 1
Optical fiber/Coaxial cable/Bluetooth/Twisted pair cable
Give reason for your answer
b) What is the purpose of Modem in network? 1
c) A school with 20 stand-alone computers is considering networking them together 2
and adding a server. State 2 advantages of doing this.
d) Which of the following are valid IP addresses? Give reasons if invalid 2
(i) 121.23.1.45
(ii) 192.168.0.254
(iii) 192.168.0.1
(iv) 198.-1.1.1
e) Does open source software only mean that the software is free of cost? Give reason 2
for your answer.

f) What was the objective behind developing UNICODE? 2


2 a) Write Java code for following tasks: 4
(i) To assign the value 500 to variable x. Increase the value of x by 50 and store it in
variable y.
(ii) Now check using if condition whether the x is greater than 500 or not. Display
"Greater" if greater than 500 otherwise display "Lesser".
b) Write the output that will be generated by the code given below: 2
int i;
i=7;1∞ ↑↑
int r;
r=8;
while(i<=10)
{
System.out.println(r*i);
i=i+2;
}
OR
What will be displayed in jTextArea1 after the execution of the following loop?
for (int I=5;I<=25;I+=5)
jTextArea1.setText(jTextArea1.getText() + " " + Integer.toString(2*I));
c) Given below is a code. 4
<message>
<text>Hello, world!</text>
</message>
(i) Which language is used to write the above code?
(ii) What are <message>, </message>, <text> and </text>?
OR
"With XML there are no predefined tags" - Explain in brief with the help of an
example. Also compare XML with HTML.

3 a) What is MySQL? 1
b) Consider the following table "SBOP" with details of account holders. 4

Write commands of MySQL for following purpose-


(i) To display Accountno, Name and DateOfopen of account holders having
transactions more than 8.
(ii) To display all information of account holders whose transaction value is not
mentioned.
(iii) To add another column Address with datatype and size as VARCHAR(25)
(iv) To display the month day with reference to DateOfopen for all the account
holders
c) Observe the table named as "SBOP" given above carefully and predict the output of 4
the following queries:
(i) SELECT COUNT(*) FROM SBOP;
(ii) SELECT Name, Balance FROM SBOP WHERE Name LIKE '%i';
(iii) SELECT ROUND(Balance, 2) FROM SBOP WHERE Accountno = 'SB-5';
(iv) SELECT AVG(Transaction) FROM SBOP;
d) What is the degree of the above given table named 'SBOP'. 1
4 a) What is difference between jTextField and jPasswordField components? 1
b) Write a Java statement to: 1
Append a string "ABC" to the text that is already in the text area named jTextArea1.
OR
Write Java statement to make a jTextField1 uneditable during execution.
c) Rewrite the following code using IF ELSE IF instead of SWITCH statement: 1
String tour;
int cl = Integer.parseInt(jTextField1.getText());
switch(cl){
case 8: tour = "You are going to camp ramgarh";
break;
case 9: tour = "You are going to Manali, Rohtang Pass";
break;
case 10: tour = "You are going to Chail";
break;
default: tour = "No school tour for you this time";
}
d) How many times will the following WHILE loop execute after removing all the 4
possible syntax errors?
int y=7, sum=0;
while(y<=15)) {
sum = SUM+y
y=y+2;
}
Out of entry controlled or exit controlled loop, above given loop will come under
which category and why?
OR
How many times will the following DO-WHILE loop execute after removing all the
possible syntax errors?
int i=0;
int sum=0;
do {
sum =+ i
i=i+1;
}while(y<=5);
Out of entry controlled or exit controlled loop, above given loop will come under
which category and why?

e) Write the contents of jTextField1, jTextField2, jTextField3 and jTextField4 when the 2
following statements are executed:
String x;
String str = "Java";
x = str.concat("study");
double a = 7.8765;
jTextField1.setText(x.length() + " ");
jTextField1.setText(x.toUpperCase());
jTextField1.setText(x.substring(2,5));
jTextField1.setText(Math.round(7.8765) + " ");
f) Ms. Fauzia works as a programmer in "TelTel Mobile Company" where she has 6
designed a software to compute charges to be paid by the mobile phone user. A
screenshot of the same is shown below:

Each Call is charged at INR 1.00


Each SMS is charged at INR 0.50
Users can also opt for Mobile Data Plan. Charges for Mobile Data Plan are flat INR
50.00
Help Ms. Fauzia in writing the code to do the following:
(i) When the 'Calculate Charges' button is clicked, 'Calls and SMS Charges', 'Mobile
Data Plan Charges' and 'Amount to Pay' should be calculated and displayed in the
respective text fields.
'Amount to Pay' is calculated as :
Calls and SMS Charges + Mobile Data Plan Charges (if any)
(ii) When the 'Clear' button is clicked, all the textfields and checkbox should be
cleared.
(iii) When the 'Exit' button is clicked, the application should close.

5 a) Sarthya, a student of class XI, created a table 'RESULT'. Grade is one of the column 2
of this table. To find the details of students whose Grades have not been entered,
he wrote the following MySQL query. Which did not give the desired result.
SELECT * FROM RESULT WHERE Grade = 'Null';
Help Sarthya to run the query by removing the errors from the query and write the
correct query.
b) Given below is the 'Department' table: 2

SET AUTOCOMMIT=0;
UPDATE Department SET DEPNAME = 'OFFICE' WHERE DEPNAME='ADMIN';
INSERT INTO Department VALUES(104,'HRD');
UPDATE Department SET DEPNAME = 'FRONT OFFICE' WHERE
DEPNAME='RECEPTION';
COMMIT;
DELETE FROM Department WHERE DEPNAME='FRONT OFFICE';
ROLLBACK;
SELECT * FROM Department;
What will be the output of the above given SELECT statement?

c) Name SQL Single Row functions (for each of the following) that 4
(i) returns a number
(ii) returns lowercase letters
(iii) returns names of days. For eg. "Monday", "Tuesday".
(iv) returns weekday number. For eg. 1 for Sunday, 2 for Monday, 3 for Tuesday.
d) How is HAVING clause similar to WHERE clause? How is HAVING clause different 2
from WHERE clause? Explain with the help of examples of each.
6 a) Write MySQL command to create the Table 'LIBRARY' with given constraints. 2
b) 2
Consider the tables given below :

(i) Which column is used to relate the two tables?


(ii) Is it possible to have a primary key and a foreign key both in one table? Justify
your answer with the help of table given above.

c) With reference to the above given tables, write commands in SQL for (i) and (ii) and 6
output for (iii)
(i) To display CourseId, TeacherId, Name of Teacher, Phone Number of Teachers
living in Delhi.
(ii) To display Teacher Id, Names of Teachers, Subjects of all teachers with names of
Teachers starting with 'S'.
(iii) SELECT CourseId, Subject, TeacherId, Name, PhoneNumber FROM Faculty,
Course WHERE Faculty.TeacherId = Course.TeacherId AND Fee>=5000
7 a) How does e-governance empower citizens? Write two points. 2
b) Define e-learning. Give one popularly used website of e-learning. 1
c) Ms. Cathy is creating a form for Vidya University Sports Council application. Help 2
her to choose the most appropriate controls from ListBox, ComboBox, TextField,
TextArea, RadioButton, CheckBox, Label and Command Button for the following
entries :

Vous aimerez peut-être aussi