You are on page 1of 5

(ii) Write the correct statement required to open a temporary file named

updateemp.dat. (Statement 2)
(iii) Which statement should Alia fill in Statement 3 to read the data from the
binary file, EMPLOYEE.DAT and in Statement 4 to write the updated data
in the file, updateemp.dat?

COMPUTER SCIENCE (083)


SAMPLE PAPER - I MARKING SCHEME
Maximum Marks: 70 Time Allowed: 3 hours
1. pass (Q 1-18 – 1 Mark each)
2. a
3. a
4. c
5. I, 3
6. d
7. b
8. b
9. d
10. d
11. d
12. d
13. c
14. a
15. a
16. c
17. a
18. c
19. def Tot (Number):
Sum=0
for C in range (1, Number + 1):
Sum + = C (½ mark for each correction)
return Sum
print (Tot (3))
print (Tot(6)
20. HTTP - Hyper Text Transfer Protocol
- protocol used to transfer files from a web server to browser to view a webpage on the internet
- defines the format and transfers the webpage
FTP - File Transfer Protocol
- Protocol used to upload files from a workstation to a FTP server or download files from a
FTP server to a workstation
- Used to transfer the file from one system to another
(Any two differences. Each difference 1 mark)
OR
Advantages (Any two advantages and disadvantages – ½ mark each)
• Provide easy access for service or reconfiguration of the network

201 | P a g e
• One device per connection
• Simple access protocols
Disadvantages
• Central node dependency
• Long cable length
21. 3, 2, 01 (2 marks)
22. All attributes or group of attributes of a table that can identify a tuple uniquely is called a candidate key.
(1 mark)
ITEM
Ino Item Qt
I01 Pen 565
I02 Pencil 780
I03 CD 450
I04 Eraser 300
I05 Duster 200
Candidate keys – Ino, Item (Any example – 1 mark)
23. (a) SMTP – Simple Mail Transfer Protocol (½ mark each)
IPR – Intellectual Property Rights
(b) TELNET (1 mark)
24. (b) and (d) (1 mark)
Maximum value of X: 2 (½ mark each)
Minimum value of X: 1
OR
10 # 0 (Each line - ½ mark)
10 $ 20
1#0
1 $ 20
25. Delete - Data Manipulation Language (DML) command and used when you want to remove some or
all the tuples from a relation
Drop - Data Definition Language (DDL) command whichremoves the table from database
Syntax: (Definition – 1 mark ; Syntax: 1 mark)
Delete: DELETE FROM relation_name
WHERE condition;
Drop: Drop table tablename;
OR
SELECT department, avg(salary) from company Group by department; (2 marks)
26. Difference between equi join and natural join – 1 mark
Each output – 1 mark
OR
202 | P a g e
(i) insert into House values (‘Tulip’,’Rajesh’,278); (1 mark)
(ii) Each output ½ mark
27. def countwords( ):
S= open(“Quotes.txt”, “r”) (Opening the file in correct mode and closing – 1 mark)
f = S. read() ½ mark
z= f.split( ) ½ mark
for i in z: ½ mark
count = count + 1
print(“Total number of words”, count) ½ mark
S.close()
OR
def countlines():
file=open(“STORY.TXT”, “r”) (Opening the file in correct mode and closing – 1
mark)
lines= file.readlines() ½ mark
count=0
for w in lines:
if w[0]== ‘A’ or w[0]== ‘a’: 1 mark
count=count+1
print(“Total lines starting with A:”, count) ½ mark
file.close()
28.(i) PID – int(11)
ProdName – varchar(10)
DateofManufacture – Date
Price – float(7, 2)
(ii) ALTER TABLE Customer MODIFY Address(30);
29. def INDEX_LIST(L):
indexList=[]
for i in range(len(L)):
if L[i]!=0:
indexList.append(i)
return indexList
(½ mark for correct function header
1 mark for correct loop
1 mark for correct if statement
½ mark for return statement)
30. def Push(Package):
Empid=int(input(“Enter Id of Employee: "))
Ename=input(“Enter Name of employee”)
Salary= int(input(“Enter Salary of an employee”))
T=(Empid, Ename ,Salary)
Package.append(T)
def Pop(Package):
if (Package==[]):
print( "Stack empty")
203 | P a g e
else:
print ("Deleted element:",Package.pop())
OR
def PUSH(Arr,value):
s=[]
for x in range(0,len(Arr)):
if Arr[x]%5 and Arr[x]%3==0:
s.append(Arr[x])
if len(s)==0:
print("Empty Stack")
else:
print(s)
def popStack(st) :
if len(st)==0: # If stack is empty
print("Underflow")
else:
print(“Element deleted is”,st.pop( ))
31. (i) Block A
(ii) Any correct cable layout – 1 mark
(iii) (a) In all blocks
(b) To be placed between blocks where distance is greater than 70m
(iv) Radiowaves
(v) LAN
32. (i) 9 60 P$R$S$
(ii) import mysql.connectoraspymysql
dbcon=pymysql.connect(host=”localhost”, user=”root”, passwd=”sia@1928” ,database=” oraclenk”)
if dbcon.isconnected()==False
print(“Error in establishing connection:”)
cur=dbcon.cursor()
query=”select * from stmaster”
cur.execute(query)
resultset=cur.fetchmany(3)
for row in resultset:
print(row)
dbcon.close()
OR
(i) In the function add() global c is increment due to use of global keyword. In the main program
local c is printed as local takes precedence over global c. If global c is not used then c=c+2 will
show error as there is no local variable c in function.
(ii) (i) import mysql.connector
(ii) execute ()
(iii)mysql.connector.connect(host=”192.168.11.111”,user=”root”,passwd=”Admin”,databa 146
se=”MYPROJECT”)
33. (i) writerow() – 1 mark

204 | P a g e
writerows() – 1 mark
(ii) Definition of add() – 1 mark
Definition of search() – 1 mark
Function call – 1 mark
OR
(i) seek() – 1 mark
tell() – 1 mark
(ii) Definition of ADD() – 1 mark
Definition of COUNTR() – 1 mark
Function call – 1 mark
34. Each SQL statement 1 mark
35. (i) pickle (1 mark for correct module)
(ii) fout=open(‘updateemp.dat’, ‘wb’) (1 mark for correct statement)
(iii) Statement 3: pickle.load(fin)
Statement 4: pickle.dump(rec,fout) (1 mark for each correct statement)
KENDRIYA VIDYALAYA SANGATHAN – CHENNAI REGION
Class: XII Session: 2022-23
Computer Science (083)
Sample Question Paper - II
Maximum Marks: 70 Time Allowed: 3 hours
General Instructions:
1. This question paper contains five sections, Section A to E.
2. All questions are compulsory.
3. Section A has 18 questions carrying 01 mark each.
4. Section B has 07 Very Short Answer type questions carrying 02 marks each.
5. Section C has 05 Short Answer type questions carrying 03 marks each.
6. Section D has 03 Long Answer type questions carrying 05 marks each.
7. Section E has 02 questions carrying 04 marks each. One internal choice is
given in Q35 against part c only.
8. All programming questions are to be answered using Python Language only.

SECTION A
1. State whether True or False: 1

Variable names can begin with the _ symbol.

2. Identify which of the following is an invalid data type in Python: 1


(a) int (b) float (c) super (d) None

3. Consider the following code: 1

205 | P a g e

You might also like