0% found this document useful (0 votes)
89 views8 pages

12 CS MS 08012025

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views8 pages

12 CS MS 08012025

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

KENDRIYA VIDYALAYA SANGATHAN, CHENNAI REGION

CLASS: XII SESSION: 2024-25


PREBOARD-II
COMPUTER SCIENCE (083)
Time allowed: 3 Hours Maximum Marks: 70
ANSWER KEY

Q.NO Section-A (21 x 1 = 21 Marks) Marks


1 False 1
2 c)exam 1
3 c) 4 1
4 c) ngineering 1
5 mputer netwo 1
6 d) (20, 30, [40, 400, 60], 70) 1
7 b) C 1
8 b) Removes the last element from the list and returns it. 1
9 c) Candidate Key 1
10 d)F=open(‘data.txt’)
print(F.read(20)) 1

11 False 1
12 b) 50#90 1
13 b) BETWEEN 1
14 b)SELECT * FROM PRODUCT ORDER BY PRICE DESC; 1
15 a) update 1
16 c) cursor 1
17 b) POP 1
18 c) Repeater 1
19 b)Cookies 1
20 c)A is True but R is False 1
21 d)A is false but R is True 1
Q.No Section-B ( 7 x 2=14 Marks) Marks
22 List-mutable datatype, it supports item assignment
String-immutable datatype, once created we cannot change the values.
2
Explanation-1 mark
Eg: 1 mark
23 I. in, not in ( 1 mark)
II. is,is not (1 mark) 2

24 Consider the string, str=’PREBOARD2 EXAMINATION 2024’. (Answer using


builtin functions only) 2
I.

1
a. str.find(‘2024’)
OR
b. len(str)

II.
a. str.isalnum()
OR
b. str.startswith(‘PRE’)

25 Minimum=1 (1/2 mark)


Maximum=3 (1/2 mark)
2
b) C++# Java # Ruby # C++# (1 mark)

26 N=int(input(“Enter the number”))


for i in range(n):
if i%4= =0 or i%5==0:
2
print(i)
else:
pass
27 I. a.
● Reduce data redundancy
● Reduce data inconsistency
● Data sharing
Any two point-1 mark
b)MYSQL,Oracle,Microsoft access(any two example) 1 mark
2
OR
II.
a. Domain is pool of values from which actual value is drawn(1 mark)
b. Primary key constraint - Null and duplicate values are not allowed
Unique key constraint – accepts null values but duplicate values are not
allowed.(1 mark)

28 Correct Explanation: 1 mark


Example : 1mark
OR
Expand the following 2
i. HTML-hypertext markup language(1 mark)
ii. TCP/IP-Transmission control protocol/internet protocol(1 mark)

Q.No Section-C ( 3 x 3 = 9 Marks) Marks


29 def show(): 3

2
f=open("info.txt",'r')
data=f.read()
words=data.split()
for i in words:
if len(i)>4 and i[0].upper() in 'AEIOU':
print(i)
f.close()
show()
(½ mark for correct function header)
(½ mark for correctly opening the file)
(½ mark for correctly reading from the file)
(½ mark for splitting the text into words)
(1 mark for checking the condition and displaying)
OR
def show():
f=open("poem.txt","r")
line=f.readlines()
c=0
for i in line:
c=c+1
v=0
for ch in i:
if ch.upper() in ‘AEIOU’:
v=v+1
print("Line ",c,":" v)
f.close()

(½ mark for correct function header)


(½ mark for correctly opening the file)
(½ mark for correctly reading from the file)
(1 mark for looping and checking the condition)
(½ mark for displaying with line number)

30 A)

pharmacy=[]
def Addmedicine(pharmacy,med_data):
pharmacy.append(med_data)

def remove_med(Pharmacy): 3
if pharmacy!=[]:
print(BookStack.pop())
else:
print("Underflow")
def Top_med(pharmacy):
if pharmacy==[]:

3
print("None")
else:
print(pharmacy[-1])
Addmedicine(pharmacy,med_data)
remove_med(pharmacy)
Top_med(pharmacy)

1 mark for correct each function body


OR
b)
stk=[]
l=eval(input("enter list of 10 integers"))
def insert_data():
for i in l:
if i%5==0:
stk.append(i)
def disp_data():
if stk!=[]:
print(stk[-1])
else:
print("None")
insert_even()
disp_even()
(1/2 for identifying numbers divisible by 5)
(1/2 mark for correctly adding data to stack)
(1/2 mark for correctly displaying topmost element on the stack and 1/2 mark for
checking
condition)
(1/2 mark for correctly displaying the data with none)
(1/2 mark for function call statements)
31 #26@#7@#8@#15@ (1.5 mark)
@1@#7@2 (1.5 mark)

OR
3
0 #1 #2 # (1 mark)
0 #1 #2 #3 #4 #5 # (1 mark)
0# (1 mark)

Q.NO Section-D ( 4 x 4 = 16 Marks) Marks


32 i. Select color,count(*) from rent_cab group by color;
ii. Select * from rent_cab order by vname desc;
iii. Update rent_cab set charges=35 where vname=’family car’; 4
iv. Alter table rent_cab add Date_of_manufacture date;

OR
4
i. Select Vcode, make from Rent_cab where VName like ‘%car%’;

Vcode Make

Big car Carus

Small Car Polestar

Family Car Windspeed

ii. Select Color,sum(charges) from Rent_cab group by Color;

Color Sum(charges)

Silver 10

Red 9

iii. Select max(charges) from Rent_cab;

Max(charges)

30

iv. Select * from Rent_cab where color=”white and charges =’30’;

Vcode Vname Make Color Charges

104 Classic Studio White 30

33 a. def shortlist():

import csv
f=open("registration.csv",'r')
records=csv.reader(f)
next(records, None) #To skip the Header row
4
for i in records:
if int(i[3])>=75:
print(i)
f.close()
shortlist()
(½ mark for opening in the file in right mode)

5
(½ mark for correctly creating the reader object)
(½ mark for correctly checking the condition)
(½ mark for correctly displaying the records)
b. def Waiting_list():

import csv
f=open("registration.csv",'r')
c=0
records=csv.reader(f)
next(records, None) #To skip the Header row
for i in records:
if int(i[3])>65 and int(i[3])<75:
c=c+1
return c
f.close()
Waiting_list()
(½ mark for opening in the file in right mode)
(½ mark for correctly creating the reader object)
(½ mark for correct use of counter)
(½ mark for correctly returning the counter)
34 i. Select name from games,players where gamename=’Carrom Board’
and games.gcode=players.gcode;
ii. Select game_name, name from games, players where type=’indoor’
and games.gcode=players.gcode;
iii. Insert into players values(6,’Gupta’,105);
4
iv. Select gamename,type,prizemoney from games where prizemoney is
null;
OR
Describe games;

35 def emp_details():
import mysql.connector as mycon
mydb=mycon.connect(host="localhost",user="root",passwd="Admin",database="
finance")
no=int(input("Enter employee number: "))
name=input("Enter the Name: ")
designation=input("Enter designation: ")
doj=input("Enter date of joinih: "))
salary=int(input("Enter salary: "))
mycur=mydb.cursor()
query="INSERT INTO employee VALUES ({},'{}','{}',{},{})"
query=query.format(no,name,designation,doj,salary)
mycur.execute(query)
mydb.commit()
mycur.execute("select * from employee where price>25000")

6
for rec in mycur:
print(rec)
(½ mark for correctly importing the module)
(½ mark for correctly creating the connection object)
(½ mark for correctly creating the cursor object)
(½ mark for correctly inputting the data)
(½ mark for correct creation of first query)
(½ mark for correctly executing the first query with commit)
(½ mark for correctly executing the second query)
(½ mark for correctly displaying the data)
Question 36 to 37: 5 mark
36 import pickle
def inputdata():
f=open("library.dat",'ab')
n = int(input("Enter the number of books you want to add: "))
for i in range(n):
Book_name=int(input("Enter the book name: "))
Author_name = input("Enter author Name: ")
BookID=int(input("Enter Bookid "))
price=int(input("Enter the price "))
book_data=[Book_name,Author_name,BookID,price]
pickle.dump(book_data,f)
f.close()
def Availablity_check(Book_ID):
f=open("library.dat",'rb')
found=1
try:
while True:
d=pickle.load(f) 5
if d[2]==Book_ID:
print(d)
found=0
except:
break
if found==0:
print(“not available”)
f.close()
def display():
f=open("library.dat",'rb')
c=0
try:
while True:
d=pickle.load(f)
if d[3]>500:
c=c+1
except:

7
break
print("total number of books=",c)
f.close()

(1/2 mark of import pickle)


(1/2 mark for input)
(1/2 mark for opening file in append mode and 1/2 mark for using dump)
(1/2 mark for opening file in read mode and 1/2 mark for using load)
(1/2 mark for try-except block, and ½ mark for condition for availability check)
(1/2 mark for checking the condition and ½ mark for displaying number of book)
37
i. Any suitable topology name(1/2 mark), layout-1/2 mark
ii. Satellite
iii. Administrative block-reason maximum number of computers.
iv.
a. Switch/Hub -placed in all the block
5
b. Repeater- placed between the blocks having distance greater than
100m(as per the layout given in question i)
v. LAN
OR
firewall

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy