This document outlines the pre-board examination paper for Computer Science for Class XII, including general instructions, question distribution across sections A to E, and various types of questions related to Python programming, SQL, and computer science concepts. The paper consists of 37 questions, with a total of 70 marks and a duration of 3 hours. Each section varies in the number of questions and marks, with specific instructions for programming questions to be answered in Python.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0 ratings0% found this document useful (0 votes)
43 views17 pages
Sample Paper 1
This document outlines the pre-board examination paper for Computer Science for Class XII, including general instructions, question distribution across sections A to E, and various types of questions related to Python programming, SQL, and computer science concepts. The paper consists of 37 questions, with a total of 70 marks and a duration of 3 hours. Each section varies in the number of questions and marks, with specific instructions for programming questions to be answered in Python.
ADD PRIMARY KEY ( );
(1 mark each for correct answer)
28 | (i) POP - Post Office Protocol @
Page 2of 7(ii) HTTPS: Hyper Text Transfer Protocol Secure
OR
(i) Teinet
ii) FTP
Q.NO
‘SECTION-C(3x3=9 Marks)
MARKS
29
def SHOWLINES():
f=open("EXAMCS.txt")
for line in f:
if ‘ke! not in line:
print(line.strip())
f.close()
OR
def RainCount():
feopen(‘rain.txt!)
read()
data=data.upper()
data=data.split()
c=data.count('RAIN')
print('Rain -',c)
f.close()
data:
Any other correct code
(2 mark for correct function header)
(2 mark for correctly opening the file)
(2 mark for correctly reading from the file)
(% mark for splitting the text into words)
(1 mark for correctly displaying the desired output)
@)
30
status=[]
def Push_element(cust)
if cust[2]=="Goa
L1=[cust{0],cust{1]]
status.append(L1)
def Pop_element ():
num=len(status)
while ten(status)!=0
dek
status. pop()
print(dele)
num=num-1
else:
GB)
Page 3 of 7print("Stack Empty")
(1.5 marks for correct push_element() and 1.5 marks for correct
pop_element())
OR
stackitem=[]
def Push(Sltem):
count=0
for k in SItem
if (SItem[k]>=75):
stackItem.append(k)
count=count+1
print("The count of elements in the stack is : ", count)
(1 mark for correct function header
1 mark for correct loop
Ye mark for correct If statement
1% mark for correct display of count)
31 | all#tHE#bEes @
oR
s*ue'n*s*
(deduct ¥2 mark for not printing * #)
QNO ‘SECTION-D(4x4=16 Marks) MARKS
32 [A) @
(i) SELECT * FROM TECH_COURSE WHERE CNAME LIKE 'D%’;
(ji) SELECT FEES FROM TECH_COURSE ORDER BY FEES DESC;
(ili) SELECT SUM(FEES) AS TOTAL_FEES FROM TECH_COURSE WHERE TID IS
NOT NULL;
(iv) SELECT CNAME FROM TECH_COURSE WHERE FEES <15000;
OR
8) Write the output of following queries:
@
DISTINCT TID
101
NULL
102
104
103
(ii)
TID | COUNT(*) | NIN(FEES)
sor [2 12000,
Page 4of 7Gi
‘CNAME
Digital marketing
‘Mobile Application Development
(iv) 1550.00
(4 x 1 mark for each correct output)
33
import csv
def ADD():
fout=open("record.csv","a" newline="\n")
wr=csv.writer(fout)
empid=int(input("Enter Employee id :: "))
name=input("Enter name :: ")
mobile=int(input("Enter mobile number :: "))
Ist= 1/2 mark
lempid,name,mobile]
wr.writerow(Ist)
/2 mark
fout.close()
def COUNTR():
fin=open("record.cs
"newlin
\n")
data=csv.reader(fin)
d=list(data)
print(len(d))
fin.close()
ADD()
COUNTR()
(2 mark for importing csv module
1% marks each for correct definition of ADD() and COUNTR()
1% mark for function call statements)
(4)
34
Primary Key ~ Rolino
li)Degree of table= 5
ili)Insert into fees values(101,’Aman’, XII’,5000);
iv)(A) DELETE FROM Fees;
oR
iv)(B) Desc Fees;
(4x1 mark for each correct query)
(4)
35
import mysql-connector as mysql
def DataDisplay():
con1=mysql.connect(hos!
database="school")
"localhost" user="root” passwort
mycur= con1.cursor()
no=int(input("Enter Roll Number: "))
(4)
Page 5 of 7nm=input("Enter Student Name: ")
class=int(input("Enter class: "))
marks=float(input("Enter marks: "))
query="INSERT INTO student VALUES ({},'(} 43,3)"
query=query.format(no,nm,class,marks)
mycur.execute(query)
cont.commit()
print("Students with marks greater than 75 are : ")
mycursor.execute("select * from student where Marks>75")
data= mycursor.fetchall()
for i in data:
print(i)
print()
(2 mark for correctly importing the connector object)
(2 mark for correctly creating the connection object)
(2 mark for correctly creating the cursor object)
(2 mark for correctly inputting the data)
(2 mark for correct creation of first query)
(2 mark for correctly executing the first query with commit)
(a mark for correctly executing the second query)
(4 mark for correctly displaying the data)
Q.NO
‘SECTION-E(2x5=10 Marks)
MARKS
36
import pickle
defcreateFile()
fobj=open("Book.dat","ab")
BookNo=int(input("Book Number : "))
Book_name=input("Name :
Author = input("Author:" )
Price = int(input("Price : "))
BookNo,Book_Name,Author, Price]
pickle, dump(rec,fobj)
fobj.close()
defCountRec(Author):
fobj=open("Book.dat","rb")
num = 0
try:
while True
rec=pickle.load(fobj)
()
Page 6 of 7except:
fobj.close()
return num.
Any other correct code
(1 mark of import pickle and function def)
(1 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 mark for checking the condition and updating the value)
(1 mark for checking the condition and displaying data correctly)
37
1) Layout-
ii)The most appropriate location of the server would be Research Lab, as this
building contains the maximum number of computers.
(iii)
a) For layout, since the cabling distance between Accounts to Store is quite
large, so a repeater would ideally be needed along their path to avoid loss of
signals during the course of data flow in this route. For layout2, since the
cabling distance between Store to Research Lab is quite large, so a repeater
would ideally be placed,
b) In both the layouts, a Hub/Switch each would be needed in all the
buildings to interconnect the group of cables from the different computers in
each building,
(iv) Firewall
(v) A) Twisted Pair cable / Ethernet cable
OR
B) LAN
(1 mark for correct answer)
6)
Page 7 of 7