Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

MODEL TEST PAPER–1 (ANSWER KEY)

CLASS XII
COMPUTER SCIENCE (083)
Maximum Marks: 70 Time Allowed: 3 hrs

SECTION – A
1. False
2. c. Account No
3. c. del D1[“Red”]
4. b. –88.0
5. a. 4
6. c. dump
7. c. distinct
8. c. Update
9. d. Statement 4
10. a. Primary Key
11. c. fobj.writelines(sequence)
12. a. GROUP BY
13. d. WAN
14. c. a and b not c
15. c. count(*)
16. b. rowcount
17. ii. Both A and R are true and R is not the correct explanation for A
18. i. Both A and R are true and R is the correct explanation for A
SECTION – B
19. def sum(numbers):
total = 0
for x in numbers:
total += x
return total
print(sum([4, 6, 3, 5, 6]))
20. Modem: A MODEM (Modulator DEModulator) is an electronic device that enables a computer to transmit
data over telephone lines. It is a device used to convert digital signals into analog signals and vice versa.
Router: A router is a networking device that forwards data packets from the source machine to the
destination machine over a network by using the shortest path.
OR
Star topology Bus topology
A central hub is required to connect all computers A long cable known as backbone is used to connect
with each other. all computers with each other.
The data is transmitted from the sender to the The data is transmitted through a long cable from
receiver by passing through the hub. the sender to the receiver.

Model Test Paper–1 (Answer key) A.1


21. a. optrSinew
b. [10, 20, 30, 10000, 60, 70]
22. An attribute or a set of attributes which is used to uniquely identify a row in a table is known as Primary
key while a Foreign key is a key which is used to link two tables together. Foreign key is a column or a
combination of columns whose values match a Primary key in a different table.
No, a table cannot have multiple Primary keys, i.e., each table can have only one Primary key but a table
may have multiple Foreign keys.
23. a. VoIP stands for Voice over Internet Protocol. VoIP is the transmission of voice and multimedia over an
internet connection. It allows users to make video calls.
b. (i) POP: Post Office Protocol (ii) XML: Extensible Markup Language
24. [100, 228, 432, 60, 800]
OR
1
3
3
(30, 9.5, 'item', [12, 13])
25. (i) AVG() function: It is used to find the average value of any column or expression based on a condition.
For example,
Select AVG(Salary) from Employee;
It will display average salary from the table Employee.
(ii) SUM() function: It is used to find the total value of any column or expression based on a condition.
For example,
Select Sum(Salary) From Employee Where Salary >50000;
It will add the salary of all employees whose salary is greater than 50000.
OR
DDL commands:
(i) Create Table command: It is used to create a table.
(ii) Alter Table command: It is used to add, delete or modify columns in a table.
DML commands:
(i) Update command: It is used to modify rows in a table.
(ii) Delete command: It is used to delete a row or all rows from the table.
SECTION – C
26. a.
Ccode CarName Charges CCode CName
501 A-Star 18 1001 Hemant Sahu
503 Indigo 16 1001 Hemant Sahu
502 Innova 15 1001 Hemant Sahu
509 SX4 14 1001 Hemant Sahu
501 A-Star 18 1002 Raj Lal
503 Indigo 16 1002 Raj Lal
502 Innova 15 1002 Raj Lal
509 SX4 14 1002 Raj Lal
501 A-Star 18 1003 Feroza Shah
503 Indigo 16 1003 Feroza Shah
502 Innova 15 1003 Feroza Shah
509 SX4 14 1003 Feroza Shah

A.2 Computer Science–XII


501 A-Star 18 1004 Ketan Dhar
503 Indigo 16 1004 Ketan Dhar
502 Innova 15 1004 Ketan Dhar
509 SX4 14 1004 Ketan Dhar
(b) (i)
Dcode MAX(UnitPrice)
101 22
102 20
103 8
(ii) COUNT(DISTINCT Dcode)
3

(iii) Qty*UnitPrice
4400

(iv) MIN(StockDate)
2009-01-01

27. def count_H_T():


f = open("Poem.txt", "r") lines =0
l =f.readlines()
for i in l:
if i[0]=='H' or i[0]==’T’:
lines+=1
print("No. of lines are: ", lines)
f.close()
OR
f = open("MYFILE.txt","r")
count = 0
x = f.read()
print(x)
for i in x:
if ( i == " "):
x=x.replace(' ','-')
print(x)
f.close()
Replace_Space()
28. (a) (i)
M_Company M_Name M_Price M_Qty
Samsung Galaxy 4500 300
Nokia N1100 2250 250
Nokia N1100 2250 150
Micromax Unite3 4500 450
Oppo SelfieEx 8500 150
Oppo SelfieEx 8500 50

Model Test Paper–1 (Answer key) A.3


(ii) MAX(M_Price)
8500

(iii) M_Supplier M_Qty


Praveen Gallery 250
The Mobile 150

(iv)
M_Company
Samsung
Micromax
USE Stock;
(b)
29. def COUNTNOW(PLACES):
for i in PLACES.values():
if len(i)>5:
print(i)
PLACES={'1': "DELHI", '2': "LONDON", '3': "PARIS", '4': "NEW YORK", '5':
"DUBAI"}
30. (i) list1=[]
def Push_element():
stud=[]
while True:
H_No= int(input("Enter Hostel Number"))
Total_Stud= int(input("Enter Total Students"))
Total_Rooms=int(input("Enter Total Rooms"))
L1=[H_No,Total_Stud,Total_Rooms]
list1.append(L1)
print(list1)
ans=input("Do you want to add more Y/N")
if ans=='N' or ans=='n':
break
Push_element()
(ii) def Pop_element ():
num=len(list1)
while len(list1)!=0:
data=list1.pop()
print(data)
num=num-1
else:
print("Stack Empty")
Pop_element()

A.4 Computer Science–XII


OR
Book_stack=[]
def Push(book_details):
count=0
for k in book_details:
if (book_details[k]>=500):
Book_stack.append(k)
count=count+1
print("The count of elements in the stack is : ",count)
books={"Python":560,"Java":450,"MySQL":330,"Web Development":725}
Push(books)
SECTION – D
31. (a) Bus topology
Cable layout:
Zone Zone
Z Y

Zone Zone
X U

(b) The most suitable place (i.e., Zone) to house the Server is Zone Z as it has the maximum number of
computers.
(c) The repeater is used to strengthen the signal where the distance between two computers in a network
is greater than 100m. So, the repeater can be placed between Zone Y to Zone X and Zone X to
Zone U.
Hub/switch should be placed in each zone.

Zone Zone Hub


Hub
Z Y
Hub Hub

Zone Zone
X U

(d) Twisted Pair cable


(e) Firewall
32. (a) 100$10000
(b) (i) Statement 1 – con.cursor()
(ii) Statement 2 – mycursor.execute(query)
(iii) Statement 3 – con.commit()
OR
(a) ipV$$$$$$BIT
(b) (i) S tatement 1: mycursor= con.cursor()
(ii) Statement 2: mycursor.execute("select * from Employee where Salary>75000")
(iii) Statement 3: data= mycursor.fetchall()
33. (i) The csv.writer() function is used to write into CSV files. This function allows us to write a list of fields to
the file. The fields can be strings or numbers or both.

Model Test Paper–1 (Answer key) A.5


(ii) import csv
def AddRecord():
fout=open("Mobile_Phones.csv","a",newline="\n")
wr=csv.writer(fout)
Model_Number=input("Enter Model Number:: ")
Mobile_name=input("Enter Mobile Name :: ")
Manufacturer=input("Enter Manufacturer :: ")
Price=int(input("Enter Price :: "))
lst=[Model_Number, Mobile_name,Manufacturer, Price]
wr.writerow(lst)
fout.close()
def Find():
fin=open("Mobile_Phones.csv","r",newline="\n")
data=csv.reader(fin)
for i in data:
if i[2]=='Apple':
print(i)
fin.close()
AddRecord()
Find()
OR
(i) The with open() method ensures that all the resources allocated to the file objects get deallocated
automatically once we stop using the file, i.e., we are not required to close the file explicitly while we
are required to explicitly close a file using close() function when opening the file using open() method.
(ii) import csv
def Add_Item():
fout=open("Stationary.csv","a",newline="\n")
data=csv.writer(fout)
Item_Id=input("Enter Item Id:: ")
Item_Name=input("Enter Item Name :: ")
Item_Price=int(input("Enter Price :: "))
Lst=[Item_Id, Item_Name,Item_Price]
data.writerow(Lst)
fout.close()
def Count():
fin=open("Stationary.csv","r",newline="\n")
data=csv.reader(fin)
d=list(data)
print(len(d))
fin.close()
Add_Item()
Count()

A.6 Computer Science–XII


SECTION – E
34. (i) The column RegNo in OPD table can be used to create Foreign key in Registration table because RegNo
column is the Primary key.
(ii) The cardinality is 7 and the degree of the table is 8.
(iii) (a) INSERT INTO OPD VALUES (‘R130’, ‘Naman’, 30, ‘ENT, ‘2022-10-10’,
700, ‘M’);
(b) U PDATE OPD SET Charges=Charges+200 WHERE Department = ‘ENT’;
OR (Option for part iii only)
(a) ALTER TABLE OPD DROP RoomNo;
(b) ALTER TABLE OPD Panel_Discount Varchar(50);
35. (i) pickle
(ii) f1=open(‘Result.dat’, ‘wb’)
(iii) pickle.load(fout)
(iv) if i[3]== ‘Won’ or i[3] == ‘won’:

Model Test Paper–1 (Answer key) A.7

You might also like