CBSE Sample Papers for Class 12 Informatics Practices Paper 4 are part of CBSE Sample Papers for Class 12 Informatics Practices. Here we have given CBSE Sample Papers for Class 12 Informatics Practices Paper 4.

CBSE Sample Papers for Class 12 Informatics Practices Paper 4

Board CBSE
Class XII
Subject Informatics Practices
Sample Paper Set Paper 4
Category CBSE Sample Papers

Students who are going to appear for CBSE Class 12 Examinations are advised to practice the CBSE sample papers given here which is designed as per the latest Syllabus and marking scheme, as prescribed by the CBSE, is given here. Paper 4 of Solved CBSE Sample Paper for Class 12 Informatics Practices is given below with free PDF download solutions.

Time : 3 hrs
Maximum Marks : 70

General Instructions

  • All questions are compulsory.
  • Answer the’questions after carefully reading the text.

QUESTIONS

Question 1.
(a) There is a numbered address (four parts separated by periods) that identifies a Website uniquely. What is it?
(b) Name any of the two encodings used for Indian computing language.
(c) Two students in the same room have connected their laptop using bluetooth for working on a seminar presentation. Out of the following, what kind of network they have formed? LAN, MAN, PAN, WAN.
(d) Ketan has set-up a network of computers. Now, he wants to prevent unwanted networking connections according to some filtering/blocking rules. Suggest him the solution.
(e) Write the name of the following:
(i) It is a protocol/technology used to exchange files on Internet.
(ii) It provides a set of rules to transfer files, videos, images etc., over the World Wide Web.
(f) What do you understand by network security? Name any two common threats to it.
(g) Differentiate between star topology and bus topology of network.

Question 2.
(a) What would you write in Exit button’s Action Performed method, if you want to end the execution of your Java GUI application?
(b) In the code fragment given below, what happens when choice equals to 5?

int n = 0, m = 0 ;
int choice = Integer.parselnt (args[0]) ;
if (choice == 1)
{
n = 11 ;
m = 10 ;
}
else if (choice == 2)
{
n = 20 ;
m = 220 ;
}
j OptionPane.showMessageDialog(this,"n=" + n +, "m=" + m) ;

(c) Write a Java method that takes three digits integer as parameter and returns its middle digit.

(d) Predict the output of the following HTML code :

<UL>
<LI> A few new Students: </LI>
<UL type="Square">
<LI> Sohan </LI>
<LI> Mohan </LI>
<LI> Rohan </LI>
</UL>
</UL>

(e) (i) Rewrite the following code using switch case statement :

if (value==l)
j TextFieldl.setText( "Computer Books" ) ;
else if(value==2)
j TextFieldl.setText( "English Books" ) ;
else if(value==3)
j TextFieldl.setText ( "GS Books" ) ;
else
j TextFieldl.setText ( "Wrong Choice" ) ;

(ii) Write HTML tag to do the following:
I. Insert the picture in the Web page.
II. Insert the empty line in the Web page.

Question 3.
(a) Identify the output of the following code:

SELECT LCASE ("COMPUTER SCIENCE") ;

(b) Which keyword eliminates the redundant data from a query result?
(c) Consider the table :
CBSE Sample Papers for Class 12 Informatics Practices Paper 4 1

Identify error(s) in the following SQL statement. Rewrite the correct SQL statement.

SELECT Empid AS Total_emp, AVG(Total_Salary) AMOUNT FROM SALARY;

(d) Write SQL queries for the following:
(i) Add a NOT NULL constraint in table EMP1 in which a column Designation is declared as NULL.
(ii) Drop the table EMP1.

(e) Given below is the 'TRAIN' table :
CBSE Sample Papers for Class 12 Informatics Practices Paper 4 2
(i) SET AUTOCOMMIT = 1 ;
INSERT INTO TRAIN VALUES ('T03', 'Goa') ;
ROLLBACK ;
SELECT * FROM TRAIN ;

(ii) SET AUTOCOMMIT = 0 ;
INSERT INTO TRAIN VALUES ( 'T03' .'Goa’) ;
COMMIT;
INSERT INTO TRAIN VALUES ( 'T04’ '. 'RAJASTHAN’) ;
ROLLBACK ;
SELECT * FROM TRAIN ;

Is both query output is same if yes, state the reason?

Question 4.
(a) In a SWITCH statement, what is the purpose of ‘default’ section?
(b) (i) Find the output of the following Java code snippet :

String word = "Highrise" ;
String wordl c = word.toLowerCase ( ) ;
for ( int i = 0 ; i<wordlc.length ( ) ; i +=4)
{
String extstr=wordlc.substring (i, i+2) ;
j TextAreal.append!extstr+''\n") ;
}

(ii) Write the value that will be stored in variable num after execution of following code and also define working:

int num=0 ;
for ( int j=9 ; j>=6 ; j- -)
{
if (j%3==0)
num=num+j ;
else
num = num - j ;
}

(c) (i) The following code has some error(s). Rewrite the correct code underlining all the corrections made :

int i ;
i=10 ;
do;
i=i-4;
System.out.displayin ( i ) ;
Iwhile i>=4 ;

(ii) Write a Java code to find out whether a year is a leap year or not.
(d) Ravi is a programmer at Arora Book Store. He created the following GUI in NetBeans. Help him in writing code for the following :
CBSE Sample Papers for Class 12 Informatics Practices Paper 4 5

(i) Write the code for [Calculate Price] button. Total price should be displayed in jTextField5 on clicking the CommandButton1.
(ii) To clear all the text field on clicking of [Reset] button.
(iii) To terminate the application on the click of [Exit] button.
[Assume suitable names for the various controls on the Form].

Question 5.
(a) Mr. Khanna wants to remove all the rows from STOCK table to release the storage space, but he does not want to remove the structure of the table. What MYSQL statement should be used?
(b) Consider the following two tables :
CBSE Sample Papers for Class 12 Informatics Practices Paper 4 6

Give output of the following query :

SELECT CLASSES.Class_Name, SUBJECTS.Sub_Name
FROM CLASSES. SUBJECTS
WHERE CLASSES.S_No = SUBJECTS.S_No ;

(c) (i) What are the properties of transactions maintained by database system?
(ii) Write the output of the following SQL queries :

I. SELECT SUBSTRC EASYCALCULATION', 5,11) AS String ;
II. SELECT CHAR(77, 121, 83, 81, 76) AS V;

(d) Table “LAB” is shown below. Write commands in SQL for (i) and (ii) and output for (iii) and (iv).
CBSE Sample Papers for Class 12 Informatics Practices Paper 4 7
(i) Display the SurName, Fname and City of LAB students residing in New Delhi city.
(ii) Display the LAB Sid, City and Pincode of students in descending order of Pincode.

(iii) SELECT SurName FROM LAB WHERE Fee>=20000 ;
(iv) SELECT SUM(Fee) FROM LAB WHERE Gender = 'F' ;

Question 6.
(a) (i) Write SQL query to create a table ‘BANK’ with following structure :
CBSE Sample Papers for Class 12 Informatics Practices Paper 4 11
(ii) Consider the tables TEACHER and SUBJECT given below :
CBSE Sample Papers for Class 12 Informatics Practices Paper 4 12

I. Which column is used to relate both tables?
II. Is it possible to have a primary key and foreign key both in one table? Justify your answer with the help of tables given above.

(b) With reference to the above given tables (in Q6 (a)(ii)), write commands In SQL for (j) and. (ii) and output for (iii) below :

(i) To display Teacher ID, Naine of lèachei Subject Name, Contact Number of Teachers whose qualification is MCA.
(ii) lb display Teacher ID, Teacher Name, Subject ID, Subjects of all teachers with subject name starting with ‘S’. . .

(iii) SELECT T.TID,T.TName, T.TCity, S.SID,S.SName
FROM TEACHER T, SUBJECT S
WHERE T.TID = S.TID AND S.Fee BETWEEN 500 AND 875 ;

Question 7.
(a) How does E-Business improve customer satisfaction?
(b) Write down advantages of E-Govemance over society
(c) Ram works for the customer support executive. He wishes to create controls on a form for the following functions. Choose appropriate controls from TextBox, Label, RadioButton, CheckBox, ListBox, ComboBox, CommandButton and write in third column.
CBSE Sample Papers for Class 12 Informatics Practices Paper 4 14

ANSWERS

Answer 1.
(a) IP address
(b) Two encodings used for Indian computing language are as follows:
(i) UNICODE (Universal Code)
(ii) ISCII (Indian Standard Code for Information Interchange).
(c) PAN
(d) The suggested solution for him to given problem is Firewall.
(e) (i) FTP (File Transfer Protocol) (ii) HTTP (HyperText Transfer Protocol)
(f) Network security refers to the provisions and policies adopted by the administrators to protect data during data transmission and to guarantee that these transmissions are authentic.
Two common threats to network security are as follows: (i) Trojan Horses (ii) Worms
(g) Differences between star topology and bus topology are as follows :
CBSE Sample Papers for Class 12 Informatics Practices Paper 4 16

Answer 2.

(a) System.exit (0) ;

(b) The message dialog will show the value as n = 0, m = 0.

(c) private int retMid (int num)
{
int a = num%100 ;
int b = a/10 ;
return b ;
}

(d) Output

  • A few new Students :
  • Sohan « Mohan
  • Rohan
(e) (i) switch (value)
{
case 1: j TextFieldl.setText ( "Computer Books" ) ;
break;
case 2: j TextFieldl.setText ( "English Books" ) ;
break;
case 3: j TextFieldl.setText ( "GS Books") ;
break;
default: j TextFieldl.setText ( "Wrong Choice" ) ;
}
(ii) I. <IMG> tag II. <BR> tag

Answer 3.
CBSE Sample Papers for Class 12 Informatics Practices Paper 4 3
(b) DISTINCT keyword eliminates the redundant data from a query result.
(c) The correct code is :

SELECT COUNT (Empid) AS Total_emp, AVG (Total_Salary) AS AMOUNT FROM SALARY :
(d) (i) ALTER TABLE EMP1 MODIFY Designation CHAR!2) NOT NULL ;
(ii) DROP TABLE EMP1 ;
CBSE Sample Papers for Class 12 Informatics Practices Paper 4 4

Yes, both queries output is same because in (ii) query AUTOCOMMIT is 0. When AUTOCOMMIT is OFF, all transaction control commands will be affect and when AUTOCOMMIT mode is 1 it commits and terminates the current transaction.

Answer 4.
(a) In a SWITCH statement, the default section will be executed when no match is found with switch expression to case constant value.
(b)

(i) hi
ri
(ii) Working :
iteration 1 : j=9. 9>=6 True
if (9%3==0) True
num=0+9=9
iteration 2 : j=8, 8>=6 True
if(8%3==0) False
num=9-8=1
iteration 3 : j=7, 7>=6 True
if(7%3==0) False
num=1 - 7=-6
iteration 4: j=6, 6>=6 True
if(6%3==0) True
num= -6+6=0
iteration 5: j=5, 5>=6 False

Output
0 will be stored in num.

(c) (i) The correct code is

int i ;
i=10 ;
d0
i=i -4;
System.out.println ( i ) :
}while (i>=4) ;

(ii) if (year%4==0)
System.out.println(year+"is a leap year") ;
else
System.out.println(year+"is not a leap year") ;

(d) For 1st button, we have to specify the following code :

(i) private void jButtonlActionPerformed(java.awt.event.ActionEvent evt)
{
float price, total ;
int rioc ;
price = Float.parseFloat (j TextField3.getText ( ) ) ;
noc = Integer.parselnt (j TextField4.getText ( ) ) ;
total = price * noc ;
j TextField5.setText (Float.toString(total) ) ;

(ii) For 2nd button, we have to specify the following code :

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt)
{
j TextField1.setText(” ") ;
j TextField2.setText(" ") ;
j TextField3.setText(" ") ;
j TextField4.setText(" ") ;
j TextField5.setText(" ") ;
}

(iii) For 3rd button, we have to specify the following code :

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt)
{
System.exit (0) ;
}

Answer 5.
(a) The command to delete all rows from the STOCK table without deleting the structure of the table will be as follows :

DELETE FROM STOCK ;
CBSE Sample Papers for Class 12 Informatics Practices Paper 4 8

(c) (i) Properties of transactions maintained by database system are as follows :

I. Atomicity This property ensures that either all operations of the transactions are performed in completion or none of the operations are performed and reflected in database.

II. Consistency It ensures that the database before and after the transaction is in a consistent state.

III. Isolation It ensures that each transaction executing takes place in isolation.

IV. Durability It ensures that the changes made in the database remains in it, after the successful completion of a transaction.

CBSE Sample Papers for Class 12 Informatics Practices Paper 4 9

(d)

(i) SELECT SurName, Fname, City FROM LAB WHERE City ='New Delhi' ; 
(ii) SELECT,Sid, City, Pincode FROM LAB ORDER BY Pincode DESC ;
CBSE Sample Papers for Class 12 Informatics Practices Paper 4 10

Answer 6.
(a)

(i) CREATE TABLE BANK
(
BankID VARCHAR(5) PRIMARY KEY,
BankName CHAR(10) NOT NULL. Location CHAR (10),
No_of_Branch INTEGER
) ;

(ii) I. TID
II. Yes, it is possible to have primary key and foreign key column in one table. Primary key column is used to uniquely identify each record of the table while foreign key column is used to maintain referential integrity.

As in the given table ‘SUBJECT’, SID column is a primary key while TID may act as a foreign key.

(b) (i) SELECT T.TID, T.TName, S.SName, T.TContact_No 
FROM TEACHER T, SUBJECT S
WHERE T.TID = S.TID AND T.TQualification = 'MCA' ;

(ii) SELECT T.TID, T.TName, S.SID, S.SName
FROM TEACHER T,SUBJECT S
WHERE T.TID = S.TID AND S.SName LIKE 'S%' ;
CBSE Sample Papers for Class 12 Informatics Practices Paper 4 13

Answer 7.
(a) E-Business improves customer satisfaction by using are as follows :

  1. Customers can receive highly customisable services.
  2. Even remote area customers are reached in E-Business.

(b) The advantages of E-Governance over society are as follows :

  1. A lot of productivity time of government servants and general public is saved.
  2. Transparency has increased and therefore cheating cases have been reduced.
  3. E-Governance programs have resulted in increased public participation.
  4. People have also benefited from it in the form of reduced cost and availability of the services.

CBSE Sample Papers for Class 12 Informatics Practices Paper 4 15

We hope the CBSE Sample Papers for Class 12 Informatics Practices Paper 4 help you. If you have any query regarding CBSE Sample Papers for Class 12 Informatics Practices Paper 4, drop a comment below and we will get back to you at the earliest.