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

Computer Science (Class-XII) MS - 1

H

Uploaded by

Chakshu Gera
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)
6 views8 pages

Computer Science (Class-XII) MS - 1

H

Uploaded by

Chakshu Gera
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

SALEM SAHODYA COMPLEX

CLASS: XII SESSION: 2024-25


COMPUTER SCIENCE (083)
Time allowed: 3 Hours Maximum Marks: 70
MARKING SCHEME

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

1. True (1)
2. (a) ab12ef12 (1)
3. (a) True (1)
4. (a) zxxy (1)
5. TO@AG (1)
6. (d)True (1)
7. (a) True (1)
8. (b) list1.insert(2, 5) (1)
9. (b) 4 (1)
10. (d) dump() (1)
11. True (1)
12. (a) 100#52 (1)
13. drop database (1)
14. (d) SELE T*FROM emp WHERE en me L KE “%e%” ORDER BY SAL DES ; (1)
15. (c)Decimal (1)
16. (b) Count(*) (1)
17. (d)HTTP (1)
18. (c)Ethernet Card (1)
19. Circuit switching (1)
20. (c)A is True but R is False (1)
21. (a)Both A and R are true and R is the correct explanation for A (1)
Q. No. Section-B (7 x 2 = 14 Marks) Marks

22. Mutable types are variables that can change their value after creation.
Examples - lists, dictionaries .
Immutable types are variables that cannot change their value after creation. (1+1
If you try to change an immutable variable, Python will give an error. =2)
Examples - string, tuple .
23. (i) Keywords - True, False, None
(ii) Membership operators - in, not in (1+1
=2)

24. listA = [8, 9, 10]

(i) listA[1] = 17 OR listA.pop(0) (1 mark for correct answer) (1+1


=2)
(ii) listA.extend([4, 5, 6]) OR listA.sort( ) (1 mark for correct answer)

25.
Possible outputs : a), c) and d) (½ x 2 = 1 Mark)
(2)
Least value : 10
Highest value : 15 (½ x 2 = 1 Mark)
26.

(2)

(½ mark each for correcting 4 mistakes)


27. Constraints are the checking condition which we apply on table to ensure the
correctness of data . (1 mark for correct answer)
Example- primary key, not null, default, unique etc (1 mark for correct answer)
OR (2)
i) import mysql.connector (1 mark for correct answer)
ii) It is the object that helps to execute the SQL queries and facilitate row by row
processing of records in the resultset. (1 mark for correct answer)
28. In star topology, nodes are connected to server individually whereas in bus topology
all nodes are connected to server along a single length of cable.
OR (1+1
Internet Message Access Protocol, or IMAP, is a standard email retrieval (incoming) =2)
protocol. It stores email messages on a mail server and enables the recipient to view
and manipulate them as though they were stored locally on their device(s).
Q .No. Section-C (3 x 3 = 9 Marks)
Marks
29. (a) def count H ( ):
F = open (“para.txt” , “r” )
lines =0
l=f. readlines ( )
(3)
for i in L:
if i [0]== ‘H’:
Lines +=1
print (“No. of lines are: “ , lines)
OR
(b) def filter (oldfile, newfile):
fin =open (oldfile, “r”)
fout= open (newfile, “w”)
while True: (½ mark for correct function header)
text =fin.readline ( ) (½ mark for correctly opening the file)
if len(text)==0:
(½ mark for correctly reading from the file)
break
(½ mark for splitting the text into words)
if text[0]== “@”:
continue (1 mark for correctly displaying the desired words)

fout.write(text)
fin.close( )
fout.close( )
filter(“source.txt” , “target.txt”)
30 a) (3)

b) OR
31. (3)

OR

25@
48@
83
(1 mark for each correct line of output) (deduct ½ mark for not printing @/#)
Q. No. Section-D (4 x 4 = 16 Marks)
Marks
32 (a ) (i) SELE CT NAME from GRADUATE where D IV = ‘ ’ order by NAME; (4)
(ii) SELECT NAME,STIPEND,SUBJECT, STIPEND*12 from GRADUATE;
(iii) SELECT SUBJECT,COUNT(*) from GRADUATE group by SUBJECT
having SUBJECT=’PHYSICS’ or SUBJECT=’ COMPUTER SC ’;
(iv)INSERT INTO GRADUATE value (11,’KAJOL’,3 ,’ COMPUTER SC ’,75 ,1);
(4 x 1 mark for each correct query) OR
(b) (i) 63
(ii) 800
(iii) 475
(iv) 4
33.
Let the file "furdata.csv" include following data: (2+2
=4)
34 (i) SELECT GCODE, DESCRIPTION FROM GARMENT ORDER BY GCODE (4)
DESC;
(iii) SELECT * FROM GARMENT WHERE READY DATE BETWEEN
’08- DEC07’ AND ’16-JUN-08’;
(iii) SELECT AVG (PRICE) FROM GARMENT WHERE FCODE = ‘F03’;

(iv) (a) SELECT FCODE, MAX (PRICE), MIN (PRICE) FROM GARMENT
GROUP BY FCODE;
(4 x 1 mark for each correct query) OR

(b) Select Gcode from GARMENT where Price>1000;

35. import mysql.connector (4)


mycon=mysql.connector.connect(host="localhost", user="root", passwd="admin",
database="EMPLOYEE")
mycursor=mycon.cursor()
print("\nBEFORE DELETION CONTENT OF EMP TABLE FOLLOWS: ")
mycursor.execute("SELECT * FROM EMP")
for k in mycursor:
print(k)
eno=int(input("Enter the empno which record you want to delete: "))
qr="DELETE FROM EMP WHERE empno={}".format(eno)
mycursor.execute(qr)
mycon.commit( ) # To save above DML tansactions to the databases otherwise will
not save permanently
print("\nAFTER DELETION CONTENT OF EMP TABLE FOLLOWS: ")
mycursor.execute("SELECT * FROM EMP")
for k in mycursor:
print(k)
mycon.close( )

(½ mark for correctly importing the connector object)


(½ 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)

Q. No. Section-E (2 x 5 = 10 Marks)


Marks
36 import pickle (5)
def input_candidates( ):
candidates = [ ]
n = int(input("Enter the number of candidates you want to add: "))
for i in range(n):
candidate_id = int(input("Enter Candidate ID: "))
candidate_name = input("Enter Candidate Name: ")
designation = input("Enter Designation: ")
experience = float(input("Enter Experience (in years): "))
candidates.append([candidate_id, candidate_name, designation, experience])
return candidates
candidates_list = input_candidates()
def append_candidate_data(candidates):
with open('candidates.bin', 'ab') as file:
for candidate in candidates:
pickle.dump(candidate, file)
print("Candidate data appended successfully.")
append_candidate_data(candidates_list)

(ii) import pickle


def update_senior_manager( ):
updated_candidates = [ ]
try:
with open('candidates.bin', 'rb') as file:
while True:
try:
candidate = pickle.load(file)
if candidate[3] > 10: # If experience > 10 years
candidate[2] = 'Senior Manager'
updated_candidates.append(candidate)
except EOFError:
break # End of file reached
except FileNotFoundError:
print("No candidate data found. Please add candidates first.")
return
with open('candidates.bin', 'wb') as file:
for candidate in updated_candidates:

pickle.dump(candidate, file)
print("Candidates updated to Senior Manager where applicable.")
update_senior_manager( )

(iii) import pickle


def display_non_senior_managers( ):
try:
with open('candidates.bin', 'rb') as file:
while True:
try:
candidate = pickle.load(file)
if candidate[2] != 'Senior Manager': # Check if not Senior Manager
print(f"Candidate ID: {candidate[0]}")
print(f"Candidate Name: {candidate[1]}")
print(f"Designation: {candidate[2]}")
print(f"Experience: {candidate[3]}")
print("--------------------")
except EOFError:
break # End of file reached
except FileNotFoundError:
print("No candidate data found. Please add candidates first.")
display_non_senior_managers()

(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 mark for checking the condition and updating the value)
(1 mark for checking the condition and displaying data correctly)

37 (a) Most suitable place to install the server is HR center, as this center has (5)
maximum number of computers.
(1 mark for correct answer)
(b)

(or Any other correct layout)

(1 mark for correct answer)

(c) Switch (1 mark for correct answer)

(d) Repeater may be placed when the distance between 2 buildings is more than
70 meter. (1 mark for correct answer)

(e) (i) WAN, as the given distance is more than the range of LAN and MAN.

OR

(ii) (a) Video Conferencing (1 mark for correct answer)

You might also like