Xii Computer Science E
Xii Computer Science E
of pages - 16 (E)
MARKING SCHEME
PRE-BOARD EXAMINATION (2024-25)
CLASS : XII
SUBJECT: COMPUTER SCIENCE (083)
Time Allowed : 3 hours Maximum Marks : 70
1. FALSE (1)
2. A (1)
3. C (1)
4. B (1)
5. A (1)
6. D (1)
7. A (1)
8. D (1)
9. D (1)
10. B (1)
11. C (1)
12. D (1)
13. B (1)
14. A (1)
15. C (1)
1 XII-COMPUTER SC.-E
17. D (1)
18. B (1)
19. A (1)
20. D (1)
21. C (1)
22. Global variables: Defined outside of any function, usually at the top (2)
be accessed from within the function or block where they are defined
def demo():
print(A)
demo()
print(A)
1 mark for correct difference between global and local variable. Half
mark for correctly identifying global variable and Half mark for
2 XII-COMPUTER SC.-E
23. Error: Errors represent serious issues that occur at the system level or (2)
issues with the Python interpreter itself. These are generally
unrecoverable and signify conditions that the programmer typically
does not handle.
a=f.read()
b=a.split()
z=0
for i in b:
if i[0]=='S':
z+=1
f.close()
Half mark for opening the file in read mode. Half mark for reading the
file. Half mark for correct loop. Half mark correctly counting the
words.
3 XII-COMPUTER SC.-E
OR
f=open('Employee.txt')
a=f.readlines()
z=0
for i in a:
z+=1
f.close()
Half mark for opening the file in read mode. Half mark for reading the
file. Half mark for correct loop. Half mark correctly counting the
lines.
25. Correct answer is option C because randrange function will never (1+1=2)
give value 3 to b. So, multiplication of a and b will never give 9.
L1=[]
L1.append(L[i])
return L1
4 XII-COMPUTER SC.-E
L = [1, 2, 3, 4, 5]
print(reverse_list(L))
27. A Primary Key constraint enforces the uniqueness and non- (2)
nullability of a column or set of columns, ensuring each record in a
table can be uniquely identified. This is critical for maintaining the
integrity and structure of relational databases.
1 Mark for correct definition and 1 mark for writing NOT NULL.
OR
Half Mark for writing create table keyword. Half mark for each pair of
5 XII-COMPUTER SC.-E
OR
etc.
1 Mark for correct definition of topology and Half mark each for two
correct examples.
for i in range(100,7000):
print(i**0.5)
Half mark for correct function definition. 1 mark for correct loop. 1
6 XII-COMPUTER SC.-E
OR
def swap(D):
D1={}
for i in D:
D1[D[i]]=i
return D1
D={1:2,3:4,5:6,7:8}
print(swap(D))
Half mark for correct function definition. 1 mark for correct loop. 1
mark for correct swapping. Half mark for correct output.
a=int(input("Enter ID = "))
node=[a,b,c]
if len(S1)<1000:
S1.append(node)
else:
print("Over Flow")
7 XII-COMPUTER SC.-E
def POP(S1):
if len(S1)==0:
print("Under Flow")
else:
return S1.pop()
In push function, Half mark for correct node creation. Half mark for
adding data to the stack after correct condition. Half mark for printing
over flow.
In pop function, Half mark for under flow condition. Half mark for
printing underflow. Half mark for popping the correct node.
OR
def PUSH(book):
node=(a,b)
book.append(node)
def DISPLAY(S1):
for i in S1:
if i[0]%2!=0:
print(i[1])
8 XII-COMPUTER SC.-E
In push function, Half mark for correct node creation. Half mark for
correct condition. Half mark for correctly pushing the node in the
stack.
In pop function, Half mark for correct loop. Half mark for correct
condition. Half mark for printing the correct output.
31. 1- (3)
##@
111-
****%
#####@
******%
OR
9 XII-COMPUTER SC.-E
OR
(i)
ID S_Name
D1002 John
D1003 Mohan
D1005 Anwar
(ii)
D1005 Anwar 11 A
(iii)
Nisha 10 C
Aman 10 A
John 11 B
Anwar 11 A
Mohan 12 C
(iv)
S_Name
Nisha
10 XII-COMPUTER SC.-E
1 mark for each correct output.
records=[]
f=open('RAILWAYS.CSV','a')
for i in range(50):
d=[PNR,Passenger_Name,Fare]
if Fare>999:
records.append(d)
w=csv.writer(f)
w.writerows(records)
f.close()
def Read_Rail():
f=open('RAILWAYS.CSV')
a=csv.reader(f)
for i in a:
if i[0]==PNR:
print("Fare = ",i[2])
11 XII-COMPUTER SC.-E
f.close()
In Read_Rail Fucntion, Half mark for opening the file in read mode.
Half mark for reading the data form file. Half mark for correct loop.
Half mark for correcting printing the data based on condition.
(iii) Degree = 9
Cardinality = 30
OR
def Insert():
12 XII-COMPUTER SC.-E
cur=con.cursor()
cur.execute(query)
con.commit()
con.close()
def Delete():
con=mys.connect(host="localhost",user="root",passwd='123456',
database="city")
cur=con.cursor()
cur.execute(query)
con.commit()
con.close()
13 XII-COMPUTER SC.-E
For Insert function, Half mark for establishing the connection. Half
Mark for creating cursor. Half mark for executing correct query. Half
mark for commit.
For Delete function, Half mark for creating cursor. Half mark for
correct query. Half mark for executing query. Half mark for commit.
Unpickling:
import pickle
f=open("data.dat","rb")
a=pickle.load(f)
x=a.find('Asd//5#')
14 XII-COMPUTER SC.-E
y=a.find('GHs89?')
z=a.find('ItL6$$#')
if x!=-1:
else:
if y!=-1:
else:
if z!=-1:
else:
f.close()
difference required). Half mark for opening the file in read mode. Half
mark for reading data from file. Half mark for finding index of first
string. Half mark for finding index of second string. Half mark for
finding index of third string. Half mark for printing Not found if any
15 XII-COMPUTER SC.-E
of the string is not found in file.
37. (i) Management block is the most suitable place to install server at (5x1=5)
Roorkee campus as it has maximum number of computers.
(ii)
(iii)
16 XII-COMPUTER SC.-E