12 CS Ernakulam-Sample Question Papers-22-23-2-Ans
12 CS Ernakulam-Sample Question Papers-22-23-2-Ans
in/web_material/CurriculumMain22/CS2022-
CLASS XII SAMPLE PAPER -2 2022-23(SOLUTION) 23.pdf
is an URL where cbseacademic.nic.in is the domain name.
21 a. GPRS – General Packet Radio Services 2
Subject: COMPUTER SCIENCE (083)
b. GSM – Global System for Mobile communications
KVS RO EKM - STUDENT SUPPORT MATERIAL (COMPUTER SCIENCE-083) FOR THE ACADEMIC YEAR 2022-23 247 KVS RO EKM - STUDENT SUPPORT MATERIAL (COMPUTER SCIENCE-083) FOR THE ACADEMIC YEAR 2022-23 248
print(m) print(i)
f.close()
#multiple returned values accepted in multiple variables Disp_upper_first()
p,q,r=fun1(10,11,12) Note : Any correct code giving the same result is also accepted
print(p,q,r)
23 2 OR
CORRECTED CODE:
def countdigits():
c=0
for Name in ['Aakash', 'Satya', 'Tarushi']:
f=open("marks.txt","r")
if Name[0]=='S':
line=f.read()
print(Name)
24 2 print(line)
Minimum VALUE = 0 for i in line:
Maximum VALUE = 3 if i.isdigit():
Options (ii) & (iii) c+=1
print("Total number of digits in the file:",c)
are incorrect.
25 2 f.close()
Alternate Keys are candidate keys which are not selected as Primary Key.
countdigits()
Table: STUD
Note : Any correct code giving the same result is also accepted
AdmNo RollNo Name i.
28 Make Count(*) 3
1236 101 Amarnath
Toyota 1
1457 102 Piyush Suzuki 1
ii.
1836 103 Swetha Cname Make
In the above table STUD, AdmNo and RollNo are candidate keys, If RollNo Innova Toyota
is selected as Primary Key then AdmNo will be the alternate key. Duster Renault
SECTION C Ertiga Suzuki
26 def Interchange(num): 3 Harrier Tata
for i in range(0,n,2): Altroz Tata
num[i], num[i+1] = num[i+1], num[i]
Triber Renault
print(num)
iii.
num=[5,7,9,11,13,15] Custname Cname
n=len(num) Gopinath Triber
if n%2==0: Ashok Altroz
Interchange(num)
Harshini Harrier
Note : Any correct code giving the same result is also accepted
27 def Disp_upper_first(): 3 Vishnu Duster
word="" 29 def Push(nums):
f=open("legend.txt","r") li =[] 3
line=f.read() for i in range(0,len(nums)):
word=line.split() if nums[i]%2!=0:
for i in word: li.append(nums[i])
if i[0].isupper(): if len(li) == 0:
KVS RO EKM - STUDENT SUPPORT MATERIAL (COMPUTER SCIENCE-083) FOR THE ACADEMIC YEAR 2022-23 249 KVS RO EKM - STUDENT SUPPORT MATERIAL (COMPUTER SCIENCE-083) FOR THE ACADEMIC YEAR 2022-23 250
print('Stack is empty!!') Type = input(“Enter the vehicle type: “)
else: Make = input(“Enter the manufacturer name: “)
print(li) Year = int(input(“Enter the year of manufacturing: "))
Push([10,15,20,25,30,35])
rec = [RegNo, Type, Make, Year]
Note : Any correct code giving the same result is also accepted
pickle.dump(rec, f1)
OR f1.close()
def popStack(names) : def CountVahan(Type):
L = len(names) f1 = open(“vehicle.dat”, “rb”)
if L==0: count = 0
print("Stack Underflow") try:
else: while True:
val = names[L-1] rec = pickle.load(f1)
names.pop(L-1) if Type == rec[1]:
return val count = count + 1
res=popStack(['Harikaran','Balaji','Nikhil','Cathrine']) except:
print('Value returned:',res) f1.close()
Note : Any correct code giving the same result is also accepted return count
30 OUTPUT : 3 OR
pRE2bOARDxeXAMaddd import pickle
SECTION -D def ShowPlayer():
31 (i) Most suitable place to install the server is ADMIN, as this building has 5 f1 = open(“player.dat”, “rb”)
maximum number of computers. count = 0
(ii)Topology: STAR
try:
Cable layout:
while True:
rec= pickle.load(f1)
if rec[3] >50 and rec[2] == “India”:
print(rec [0], rec [1], rec [2], rec [3],sep=”\t”)
count +=1
except:
f1.close()
print(“Number of Indian players with strike rate more than 50=”, count)
(iii) Repeater
SECTION E
(iv) Satellite Link 34 (a) BookNo 4
(v) (c) Video Conferencing
32 (i) Select Cname, Charges from Car where Colour=’silver’; 5 (b) Degree=4 Cardinality =7
(ii) Select distinct Ccode from customer; (c) UPDATE collections SET quantity = quantity + 20 WHERE quantity < 50;
(iii) Select min(Charges), max(Charges) from Car; (d) DELETE FROM Collections;
(iv) Update Car set Charges=Charges - Charges*0.1 from Car R, Customer C 35 (a) Line 1 :import csv 4
where R.Ccode=C.Ccode;
(b) Line 2 :f=open('students.csv','a')
(v) Select Cname, Make from Car where Charges between 2000 and 3000;
33 5 (c) Line 3 :readerObj=csv.reader(fobj)
import pickle
def AddVahan(): (d) Line 4: Not mandatory, as we have opened the file using “with” operator, it
f1= open(“vehicle.dat”, “ab”) closes automatically.
RegNo = input(“Enter the vehicle registration number: “)
KVS RO EKM - STUDENT SUPPORT MATERIAL (COMPUTER SCIENCE-083) FOR THE ACADEMIC YEAR 2022-23 251 KVS RO EKM - STUDENT SUPPORT MATERIAL (COMPUTER SCIENCE-083) FOR THE ACADEMIC YEAR 2022-23 252