Computer Science Unsolved Sample Paper Solutions CBSE Class 12
Explanation: A dictionary may be updated by the contents of another using the update() method of a dictionary.
2. (a) Logical
3. (b) 4
4. (c) No output
5. (b) [77, 10]
6. (c) r+
7. (a) 1
8. (c) CHECK
9. (a) *
10. (c) More than 2
11. (c) <fileobject>.write(<string>)
12. (d) Multiple
13. (a) RJ45
Explanation: The Registered jack 45 is a network device that connects the network cable to the network interface card.
14. (a) 11.5 <class ‘float’>
15. (d) Group by
16. (a) execute()
17. (a) Both A and R are true and R is the correct explanation for A
Explanation: Python allows creating user defined modules , where all the functions of the module can stay.
18. (a) Both A and R are true and R is the correct explanation for A
Explanation: For any types of files the default opening mode is taken as read mode if no mode is specified.
19. Corrected code :
for a in Lst :
if a**2 >= 100 :
20. URL - http://www.gabsclasses.com/aboutus
Domain name - www.gabsclasses.com14
Yesh, as a location on a web server, which is called a website and each website has a unique address known as URL. So, URL can be used to access a web page.
21. (i) (c) [ ]
Explanation: Since the reverse progression is not given , the output is an empty list.
Explanation: The for loop checks for existence of the characters of the string in “stuv” , and returns the count.
22. Database: The database is a shared collection of logically related data, designed to meet the information needs of an organisation. A database is computer based record keeping system whose over all purpose is to redord and maintains information. The database holds not only the organisation’s operational data but also a description of this data. For this reason, a database is also defined as a self-describing collection of integrated records. The description of the data is known as the data dictionary or metadata (data about data).
DBMS: A Database Management System (DBMS) is a collection of programs that enables users to store, modify and extract information from a database as per the requirements. It acts as an interface between the application program and the operating system to access or manipulate the database. A database management system is a piece of software that provides services for accessing a database, while maintaining all the required features of the data. Commercially available database management system in the market are dbase, FoxPro, Oracle, MySQL and DB2 etc.
23. (a) (i) TCP/IP : Transmission control protocol , Internet Protocol
(ii) IRCP : Internet relay chat protocol.
(b) • E-mail is extremely cost effective.
x : 15 y : 3 z : 12
|Fixed length||Variable length|
|Wastes unused spaces||Uses only as much memory required by the filled data.|
DDL (Data Definition Language) is a part of SQL, which provides commands for creating, altering and dropping the tables. Different DDL commands are CREATE, ALTER, DROP and RENAME.
DML (Data Manipulation Language) is a part of SQL, which provides commands for inserting, deleting and updating the information ina database. Different DML commands are SELECT, UPDATe, INSERT.
26. (a) Select Name, Type,Income from FAMILY F, OCCUPATION O where F.OccupationId= O. OccupationID where MaleMembers>2;
Select ClientName, City , ProductName , Price from CLIENT , PRODUCT where CLIENT.P_ID= PRODUCT.P_ID;
(b) (i) SELECT * FROM FAMILY WHERE Occupation = ‘Service’;
(ii) SELECT Name FROM FAMILY WHERE Femal Members > 3;
(iii) SELECT Name, Income FROM FAMILY ORDER BY Income;
(iv) SELECT Count(*) FROM FAMILY WHERE Income < 10000;
27. def counts(s):
for w in s.split(‘ ‘):
print(“ No. of is :”,iscount)
print(“ No. of was :”,wascount)
counts(“He is a good boy. She was and is a good girl”)
for w in s.split(‘ ‘):
if w in ‘aeiou’:
elif w in ‘AEIOU’:
print(“ List of words starting with lowercase vowels”,L1)
print(“ List of words starting with uppercase vowels”,L2)
counts(“A quick black elephant enters Into a jungle”)
28. (a) (i) SELECT NAME FROM DOCTOR WHERE DEPT, = ‘MEDICINE’ AND EXPERIENCE > 10;
(ii) SELECT AVG(BASIC + ALLOWANCE) FROM, SALARY WHERE SALARY.ID IN(SELECT ID FROM DOCTOR WHERE DEPT = ‘ENT’);
(iii) SELECT MIN(ALLOWANCE) FROM SALARY WHERE SALARY.ID IN(SELECT ID FROM DOCTOR WHERE SEX = ‘F’);
(iv) SELECT MAX(CONSULTATION) FROM SALARY WHERE SALARY.ID IN(SELECT ID FROM DOCTOR WHERE SEX = ‘M’);
(b) Alter table SALARY MODIFY consultation double(8,3);
29. a = [ ]
n = int(input(“Enter number of elements:”))
for i in range(1, n + 1):
b = int(input(“Enter element:”))
k = 0
num = int(input(“Enter the number to be counted:”))
for j in a :
if (j == num):
k = k + 1
print (“Number”, num, “is appear”. k. “times.”)
30. def insert():
name_pattern = re.compile (r “[A-Za-zs.]”)
n = input (“Enter name:”)
while name_pattern. search (n):
print (“Invalid name”)
print (“Enter name correctly”)
n = input()
Sname. append (n)
c = input (“Enter more name < y/n>”) upper ())
if (c! = “y’);
100 → Push
8 → Push
3 → Push
* → Pop 3.8 → Push 24
50 → Push
2 → Push
+ → Pop 2,50 → Push 52
+ Pop 52,24 → Push 76
* → Pop 76,100 → Push 7600
Final contents of stack
31. (i) Building RED is the suitable place to house the server because it has maximum number of computers.
(iii) (a) Switches are needed in every building as they help share bandwidth in every building.
(b) Repeaters may be skipped as per above layout (because distance is less than 100 m), however if building GREEN and building RED are directly connected, we can place a repeater there as the distance between these two buildings is more than 100 m.
(iv) A Modem is a network device that converts Analog signals to Digital and Digital to Analog.
(v) Firewall prevents the unauthorised access in the network.
(b) L1 = [23, 45, 12, 75, 90, 17, 87, 42, 72, 65]
def INPUT (S, L1) :
S. append (L1)
def OUT (S) :
if S! = [ ] :
return S.Pop ()
Stack1 = [ ]
for i in L1 :
if i % 5 == 0:
INPUT (Stack1, i)
if Stack1 ! = [ ] :
print.(OUT (Stack1), end = “ ”)
(a) Difference between logical error and syntax error are as follows:
|Logical Error||Syntax Error|
|1. It occurs because of wrong implementation of logic.||It occurs when statements are wrongly written violating rules of the programming language.|
|2. With logical errors, the code is syntactically correct and compiler will not show any error message.||With syntax errors, the code is not syntactically correct and compiler will show the error messages.|
|3. It produces the output, but undesired.||It does not produce any output.|
|e.g., in place of
(c = a * b) : if by mistake
(c = a + b); is written, it will be a logical error.
|e.g., in place of
(a == b) : if by mistake
(a == b); is written, it will be a syntax error.
(b) Marks = [75, 80, 56, 90, 45, 62, 76, 72]
def PUSH (St, Marks) :
St. append (Marks)
def POP (St) :
if St ! = [ ] :
return St. pop ()
Stack 1 = [ ]
for x in, Marks :
if x > 75 :
PUSH (Stack 1, x)
while True :
if Stack 1! = [ ] :
print (POP (Stack1), end = “ ”)
Ans. import csv
roll=input(“Enter roll :”)
name=input(“Enter name :”)
perc=float(input(“Enter percentage :”))
(a) Import CSV
(i) def CSVOpen():
with open (‘books.csv’, ‘______’ newline=‘ ’) as csvf : # Statement 1
cw=________ # Statement 2
_________ # Statement 3
cw.writerow([‘Rapunze’, ‘Jack’, 300])
cw.writerow([‘Barbie’, ‘Doll’, 900])
cw.writerow([‘Johnny’, ‘Jane’, 280])
(ii) def CSVRead():
with open(‘books.csv’, ‘r’) as csvf:
cr = _______ # Statement 4
for r in cr :
if_______ # Statement 5
print(‘File Not Found’)
The dot mark ◉ field are mandatory, So please fill them in carefully
To download the Sample Paper (PDF File), Please fill & submit the form below.