Class 12 Computer Science Sample Paper Term 2 Set B
Please see below Class 12 Computer Science Sample Paper Term 2 Set B with solutions. We have provided Class 12 Computer Science Sample Papers with solutions designed by Computer Science teachers for Class 12 based on the latest examination pattern issued by CBSE. We have provided the following sample paper for Term 2 Class 12 Computer Science with answers. You will be able to understand the type of questions which can come in the upcoming exams.
CBSE Sample Paper for Class 12 Computer Science Term 2 Set B
Section – A
1. Write equivalent postfix expressions for the following infix expression :
a+b*d = (a+(b*d))
Answer:
2. (a) Expand the following:
ARPANET, MAN
(b) Which device is used to connect all computers to the Internet using telephone wire?
Answer: (a) ARPANET : Advanced Research Projects Agency Network.
MAN : Metropolitan Area Network.
(b) RJ-45 is an eight wired connectors used to connect computers on a LAN.
3. What is the need of DBMS?
Answer: A DataBase Management System is a software system for easy, efficient and reliable data processing and management. It can be used for:
♦ Creation of a database.
♦ Retrieval of information from the database.
♦ Updating the database.
♦ Managing a database.
4. List the most common parameters and the usage that are passed to communicate with the database.
Answer:
5. Write the output (a) to (d) based on the table, CABHUB given below:
(a) SELECT SUM(Charges) FROM CABHUB WHERE Capacity>3;
(b) SELECT MIN(Capacity) FROM CABHUB;
(c) SELECT VehicleName, Colour FROM CABHUB WHERE Capacity>5 AND Make LIKE “T%”;
(d) SELECT Make FROM CABHUB WHERE Colour IN (“BLUE”, “RED”);
Answer: (a) SUM(Charges)
64
(b) MIN(Capacity)
3
(c) VehicleName Colour
Innova WHITE
(d) Make
Suzuki
Mercedes
6. (a) Which declaration represents that “character data will consume the same number of bytes as declared and is right padded”?
(b) Name any two DDL commands.
Answer: (a) Char
(b) ALTER, CREATE
7. Consider the table, BOOK given below:
(a) Identify the degree and cardinality of the table.
(b) Which field should be made the primary key? Justify your answer
Answer: (a) Degree: 3
Cardinality: 5
(b) CODE should be made the primary key as it will uniquely identify each record of the table.
OR
(a) Identify the candidate key(s) from the table BOOK.
(b) Consider the table AUTHOR, whose fields are A_ID, CODE, NAME
Which field will be considered as the foreign key if the tables BOOK and AUTHOR are related in a database?
Answer: (a) CODE, BNAME
(b) CODE
Section – B
8. Write an algorithm to implement push operation and pop operation.
Answer: Algorithm to implement push operation:
Step 1: Start
Step 2: Initialize top with -1.
Step 3: Input the new element.
Step 4: Increment top by one.
Step 5: stack[top]=new element
Step 6: Print “Item Inserted”
Step 7: Stop
Algorithm to implement pop operation:
Step 1: Start
Step 2: If the value of top is -1 go to step 3 else go to step 4
Step 3: Print “Stack Empty” and go to step 7
Step 4: Deleted item = Stack[top]
Step 5: Decrement top by 1
Step 6: print “Item Deleted”
Step 7: Stop
OR
Siya has created a dictionary containing names and salary as key value pairs of 5 employees.
Write a program, with separate user defined functions to perform the operation as Push the keys (name of the employee) of the dictionary into a stack, where the corresponding value (salary) is greater than 25000 and also perform the operation as Pop and display the content of the stack.
For example:
If the sample content of the dictionary is as follows:
details={“Rahul”:25000, “Jai”:45000, “Kinshu”:20000, “Riya”:18000, “Anu”:28000}
The output from the program should be:
Anu Rahul
Answer: details={“Rahul”:25000, “Jai”:45000, “Kinshu”:20000, “Riya”:18000,
“Anu”:28000}
def PUSH(E,N):
S.append(N)
def POP(E):
if E!=[]:
returnE.pop()
else:
return None
ST=[]
for k in details:
ifdetails[k]>=25000:
PUSH(ST,k)
while True:
if ST!=[]:
print(POP(ST),end=” “)
else:
break
9. (a) What are all the domain names possible in gender?
(b) Differentiate between cardinality and degree of a table with the help of an example.
Answer: (a) Male, Female and Trans gender.
(b) Cardinality is defined as the number of rows in a table. While,degree is the number of columns in a table. e.g. consider the following table:
Cardinality: 3
Degree: 2
10. Write a Python code to insert following records into table Orders as follow:
Database → Sales
userid → Salesman1
password → orders
Answer: import MySQLdb
db=MySQLdb.connect(‘localhost’,’salesman1’,’sale1’,’Sales’)
cursor=db.cursor(prepared=TRUE)
sql_query=”””INSERT INTO Orders(ORDNUMB, CUSTNO, ORDDTE) VALUES(”%s“,
‘%s‘,‘%s’)”””
rec_inst=[(‘12489’,’124’,‘01-03-98’), (‘12491’, ‘311’, ‘10-03- 98’),(‘12495’,
‘315’,‘31-03-98’),
(‘12498’,‘522’,‘10-04-98’)]
try:
cursor.executemany(sql_query,rec_inst)
print(cursor.rowcount, “Records inserted successfully”)
db.commit()
except:
db.rollback()
cursor.close()
db.close()
11. Write query (a) to (d) based on the tables, ACTIVITY and COACH given below:
(a) To display the names of all activities with their Acodes in descending order.
(b) To display sum of PrizeMoney for the Activities played in each of the Stadium separately.
(c) To display the coach’s name and acodes in ascending order of Acode from the table Coach.
(d) To display the activity name and coach name whose participants are more than 15.
Answer: (a) SELECT ACode, ActivityName FROM ACTIVITY ORDER BY ACode DESC;
(b) SELECT SUM(PrizeMoney) FROM ACTIVITY GROUP BY Stadium;
(c) SELECT Name, ACode FROM COACH ORDER BY ACode;
(d) SELECT ActivityName, Name FROM ACTIVITY A, COACH C WHERE A.ACode =
C.ACode AND ParticipantsNum>15;
12. (a) What is URL? Identify the domain name and URL from the following:
http://www.income.in/home.aboutus.html
Answer: (a) A URL (Uniform Resource Locator) is a unique identifier used to locate a resource on the Internet.
It is also referred to as a web address. URLs consist of multiple parts — including a protocol and domain name — that tell a web browser how and where to retrieve a resource. Domain name – income. in
URL-http://www.income.in/home.aboutus.html
OR
Write the features of Gateways in networking.
(b) Distinguish between MAN and WAN.
Answer: Features of gateways of networking are as follows:
♦ Gateway is located at the boundary of a network and manages all data that inflows or outflows from that network.
♦ It forms a passage between two different networks operating with different transmission protocols.
♦ A gateway operates as a protocol converter, providing compatibility between the different protocols used in the two different networks.
♦ The feature that differentiates a gateway from other network devices is that it can operate at any layer of the OSI model.
(b)
13. Rovenza Communications International (RCI) is an online corporate training provider company for IT related courses. The company is setting up their new campus in Kolkata. You as a network expert have to study the physical locations of various blocks and the number of computers to be installed. In the planning phase, provide the best possible answers for the queries (i) to (iv) raised by them.
Block to block distance (in Mtrs)
Expected computers to be installed in each block
(a) Suggest the most appropriate block, where RCI should plan to install the server.
(b) Name the topology that form to connect all three blocks for efficient communication.
(c) Which type of network out of the following is formed by connecting the computers of these three blocks?
♦ LAN
♦ MAN
♦ WAN
(d) Which wireless channel out of the following should be opted by RCI to connect to students from all over the world?
♦ Infrared
♦ Microwave
♦ Satellite
Answer: (a) Faculty studio building.
(b) Star topology
(c) LAN
(d) Satellite connection