Ans Cs 2023
Ans Cs 2023
Marking Scheme
Strictly Confidential
(For Internal and Restricted use only)
Senior School Certificate Examination, 2023
SUBJECT NAME: COMPUTER SCIENCE (SUBJECT CODE: 083) (PAPER CODE: 91)
General Instructions:
1 You are aware that evaluation is the most important process in the actual and correct assessment
of the candidates. A small mistake in evaluation may lead to serious problems which may affect
the future of the candidates, education system and teaching profession. To avoid mistakes, it is
requested that before starting evaluation, you must read and understand the spot evaluation
guidelines carefully.
3 Evaluation is to be done as per instructions provided in the Marking Scheme. It should not be
done according to one’s own interpretation or any other consideration. Marking Scheme should
be strictly adhered to and religiously followed. However, while evaluating, answers which are
based on latest information or knowledge and/or are innovative, they may be assessed for
their correctness otherwise and due marks be awarded to them. In class-X, while
evaluating two competency-based questions, please try to understand given answer and
even if reply is not from marking scheme but correct competency is enumerated by the
candidate, due marks should be awarded.
4 The Marking scheme carries only suggested value points for the answers. These are in the nature
of Guidelines only and do not constitute the complete answer. The students can have their own
expression and if the expression is correct, the due marks should be awarded accordingly.
5 The Head-Examiner must go through the first five answer books evaluated by each evaluator on
the first day, to ensure that evaluation has been carried out as per the instructions given in the
Marking Scheme. If there is any variation, the same should be zero after delibration and
discussion. The remaining answer books meant for evaluation shall be given only after ensuring
that there is no significant variation in the marking of individual evaluators.
6 Evaluators will mark( √ ) wherever answer is correct. For wrong answer CROSS ‘X” be marked.
Evaluators will not put right (✓)while evaluating which gives an impression that answer is correct
and no marks are awarded. This is most common mistake which evaluators are committing.
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #1/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
7 If a question has parts, please award marks on the right-hand side for each part. Marks awarded
for different parts of the question should then be totaled up and written in the left-hand margin
and encircled. This may be followed strictly.
8 If a question does not have any parts, marks must be awarded in the left-hand margin and
encircled. This may also be followed strictly.
9 If a student has attempted an extra question, answer of the question deserving more marks
should be retained and the other answer scored out with a note “Extra Question”.
10 No marks to be deducted for the cumulative effect of an error. It should be penalized only once.
12 Every examiner has to necessarily do evaluation work for full working hours i.e., 8 hours every
day and evaluate 20 answer books per day in main subjects and 25 answer books per day in
other subjects (Details are given in Spot Guidelines).This is in view of the reduced syllabus and
number of questions in question paper.
13 Ensure that you do not make the following common types of errors committed by the Examiner
in the past:-
● Leaving answer or part thereof unassessed in an answer book.
● Giving more marks for an answer than assigned to it.
● Wrong totaling of marks awarded on an answer.
● Wrong transfer of marks from the inside pages of the answer book to the title
page.
● Wrong question wise totaling on the title page.
● Wrong totaling of marks of the two columns on the title page.
● Wrong grand total.
● Marks in words and figures not tallying/not same.
● Wrong transfer of marks from the answer book to online award list.
● Answers marked as correct, but marks not awarded. (Ensure that the right tick
mark is correctly and clearly indicated. It should merely be a line. Same is with the
X for incorrect answer.)
● Half or a part of answer marked correct and the rest as wrong, but no marks
awarded.
14 While evaluating the answer books if the answer is found to be totally incorrect, it should be
marked as cross (X) and awarded zero (0)Marks.
15 Any un assessed portion, non-carrying over of marks to the title page, or totaling error detected
by the candidate shall damage the prestige of all the personnel engaged in the evaluation work
as also of the Board. Hence, in order to uphold the prestige of all concerned, it is again reiterated
that the instructions be followed meticulously and judiciously.
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #2/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
16 The Examiners should acquaint themselves with the guidelines given in the “Guidelines for spot
Evaluation” before starting the actual evaluation.
17 Every Examiner shall also ensure that all the answers are evaluated, marks carried over to the
title page, correctly totaled and written in figures and words.
18 The candidates are entitled to obtain a photocopy of the Answer Book on request on payment of
the prescribed processing fee. All Examiners/Additional Head Examiners/Head Examiners are
once again reminded that they must ensure that evaluation is carried out strictly as per value
points for each answer as given in the Marking Scheme.
General Instructions:
(i) This question paper contains five sections, Section A to E.
(ii) All questions are compulsory.
(iii) Section A have 18 questions carrying 1 mark each.
(iv) Section B has 7 Very Short Answer type questions carrying 2 marks each.
(v) Section C has 5 Short Answer type questions carrying 3 marks each.
(vi) Section D has 3 Long Answer type questions carrying 5 marks each.
(vii) Section E has 2 questions carrying 4 marks each. One internal choice is given in
Q.34 and 35, against Part (iii) only.
(viii) All programming questions are to be answered using Python Language only.
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #3/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
SECTION - A
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #4/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
Note:
an operator does not return any values until it is part of an expression
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #5/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
9. Which of the following statement(s) would give an error after executing the 1
following code ?
Stud={"Murugan" : 100, "Mithu" : 95} # Statement 1
print (Stud[95]) # Statement 2
Stud ["Murugan"]=99 # Statement 3
print(Stud.pop()) # Statement 4
print(Stud) # Statement 5
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #6/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
16. fetchall() method fetches all rows in a result set and returns a : 1
(a) Tuple of lists (b) List of tuples
(c) List of strings (d) Tuple of strings
Ans. (b) List of tuples
(1 mark for writing correct answer)
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #7/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
SECTION B
19. Atharva is a Python programmer working on a program to find and return the 2
maximum value from the list. The code written below has syntactical errors.
Rewrite the correct code and underline the corrections made.
def max_num (L) :
max=L(0)
for a in L :
if a > max
max=a
return max
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #8/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
OR
In case of wired transmission, the devices in the network are connected using
cables.
Wireless transmission uses waves/rays to connect devices.
OR
Any other valid difference (any one)
(2 marks for differentiating with or without examples)
OR
(1 mark each for defining each type with or without examples)
OR
(½ mark each for mentioning example of each type)
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #9/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
OR
(b) Differentiate between URL and domain name with the help of an
appropriate example.
Ans URL is the complete internet address of a webpage while Domain name is 2
just the name of the organisation/individual entity along with top-level
internet domains such as com, edu, gov, etc.
Example :
URL: https://www.ncert.nic.in/textbook/textbook.htm
Domain Name: ncert.nic.in OR www.ncert.nic.in
OR
any valid definition along with examples
(2 marks for writing any one difference with the help of examples)
OR
(2 marks for writing examples to differentiate correctly)
OR
(1 mark only for writing any one difference without examples)
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #10/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #11/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
Ans Output:
['CSCS','HINDIHINDI','PHYSICSPHYSICS','CHEMISTRYCHEMISTRY'
,'MATHSMATHS']
(2 Marks for writing the correct output with or without formatting)
OR
(b) Write the output of the code given below: 2
a =30
def call (x):
global a
if a%2==0:
x+=a
else:
x–=a
return x
x=20
print(call(35),end="#")
print(call(40),end= "@")
Ans. 65#70@
(½ marks each for the four components 65, #, 70, @ with or without
formatting)
25. (a) Differentiate between CHAR and VARCHAR data types in SQL with 2
appropriate example.
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #12/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
OR
CHAR data type is used to store strings of fixed length, while the VARCHAR
data type is used to store strings of variable-length. Eg, to store ‘India’,
VARCHAR(20) occupies only 5 bytes whereas CHAR(20) occupies 20 bytes.
OR
any other valid difference and examples
(2 Marks for mentioning one difference with the help of examples)
OR
(1 Mark each for writing explanation of each type with example)
OR
(½ Mark for each term for mentioning only purpose without example)
OR
(b) Name any two DDL and any two DML commands. 2
DDL – CREATE, ALTER, DROP (OR any two valid DDL command)
DML – INSERT, UPDATE, DELETE, SELECT ( OR any two valid DML command)
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #13/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
SECTION-C
26 (a) Consider the following tables – LOAN and BORROWER: 1
Table : LOAN
Table : BORROWER
CUST_NAME LOAN_NO
JOHN L-171
KRISH L-230
RAVYA L-170
How many rows and columns will be there in the natural join of these two
tables ?
Ans. Rows : 2
Columns : 4
(½ Mark each for correct values of Rows and Columns)
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #14/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
(b) Write the output of the queries (i) to (iv) based on the table, WORKER 2
given below:
TABLE: WORKER
W_ID F_NAME L_NAME CITY STATE
Ans.
F_NAME CITY
SAHIL KANPUR
VEDA KANPUR
MAHIR SONIPAT
MARY DELHI
ATHARVA DELHI
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #15/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
Ans.
CITY
KANPUR
ROOP NAGAR
DELHI
SONIPAT
MAHIR HARYANA
ATHARVA DELHI
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #16/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
Ans.
CITY COUNT (*)
KANPUR 2
ROOP NAGAR 1
DELHI 2
SONIPAT 1
27. (a) Write the definition of a Python function named LongLines( ) which 3
reads the contents of a text file named 'LINES.TXT' and displays those
lines from the file which have at least 10 words in it. For example, if the
content of 'LINES.TXT' is as follows :
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #17/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
def LongLines():
Ans. myfile=open('LINES.TXT') # ignore 'r' mode
all_lines=myfile.readlines()
for aline in all_lines:
if(len(aline.split()>=10):
print(aline)
myfile.close()
OR
def LongLines():
with open ('LINES.TXT') as myfile: # ignore 'r' mode
all_lines=myfile.readlines()
for aline in all_lines:
if(len(aline.split())>=10):
print(aline)
OR
def LongLines():
myfile=open('LINES.TXT') # ignore 'r' mode
for aline in myfile:
if(len(aline.split())>=10):
print(aline)
myfile.close()
OR
def LongLines():
myfile=open('LINES.TXT') # ignore 'r' mode
s1=" "
while s1:
s1=myfile.readline()
words=s1.split()
if(len(words)>=10):
print(s1)
myfile.close()
OR
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #18/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
OR
(b) Write a function count_Dwords() in Python to count the words ending with a 3
digit in a text file "Details.txt".
Example:
If the file content is as follows:
On seat2 VIP1 will sit and
On seat1 VVIP2 will be sitting
Output will be:
Number of words ending with a digit are 4
OR
def count_Dwords():
count=0
myfile=open("Details.txt")
S=myfile.read()
Wlist=S.split()
for W in Wlist:
if i[-1] in "0123456789":
count=count+1
myfile.close()
print("Number of words ending with a digit are",count)
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #19/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
OR
def count_Dwords():
myfile=open("Details.txt")
count=0
for line in myfile:
s1=line.split()
for i in s1:
if i[-1] in "0123456789":
count=count+1
print("Number of words ending with a digit are",count)
myfile.close()
OR
28. (a) Write the outputs of the SQL queries (i) to (iv) based on the relations 2
COMPUTER and SALES given below :
Table : COMPUTER
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #20/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
Table : SALES
PROD_ID QTY_SOLD QUARTER
P002 4 1
P003 2 2
P001 3 2
P004 2 1
200 4300
LOGITECH 2
CANON 2
MOUSE 3
KEYBOARD 2
JOYSTICK 2
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #21/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
MOUSE LOGITECH 2
KEYBOARD LOGITECH 2
JOYSTICK IBALL 1
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #22/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
OR
def EOReplace():
L=[]
ch = 'y'
while ch == 'y' or ch == 'Y':
x = int(input('give item'))
L.append(x)
ch= input('do you want to enter more y/n ')
for i in range(len(L)):
if L[i]%2==0:
L[i]=L[i]+1
else:
L[i]=L[i]-1
print(L)
OR
def EOReplace():
L=eval(input("Enter list="))
Size=len(L)
for i in range(Size):
if L[i]%2==0:
L[i]=L[i]+1
else:
L[i]=L[i]-1
print(L)
OR
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #23/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
(ii) Pop_Cust() – To Pop the names of customers from the stack and
display them. Also, display “Underflow” when there are no customers in the
stack.
For example :
If the lists with customer details are as follows :
["Siddarth", "Delux"]
["Rahul", "Standard"]
["Jerry", "Delux"]
The stack should contain
Jerry
Siddharth
The output should be:
Jerry
Siddharth
Underflow
Ans. Hotel=[]
Customer=[["Siddarth","Delux"],["Rahul","Standard"],["Jer
ry","Delux"]]
def Push_Cust():
for rec in Customer:
if rec[1]=="Delux":
Hotel.append(rec[0])
def Pop_Cust():
while len(Hotel)>0:
print(Hotel.pop())
else:
print("Underflow")
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #24/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
OR
top=0
def Push_Cust(Hotel,Customer):
global top
for cust_rec in Customer:
if cust_rec[1]=="Delux":
Hotel.insert(top, cust_rec[0])
top=top+1
def Pop_Cust(Hotel):
global top
while len(Hotel)>0:
print(Hotel.pop())
top=top-1
else:
print("Underflow")
OR
Any other valid Python code to serve the purpose.
(½ mark for defining correct function header (Push_Cust())
(½ mark for correct loop in function Push_Cust())
(½ mark for checking the condition and appending the data in
Push_Cust())
(½ mark for defining correct function header (Pop_Cust())
(½ mark for correct loop in function Pop_Cust())
(½ mark for deleting and displaying the data in Pop_Cust())
OR
(b) Write a function in Python, Push (Vehicle) where, Vehicle is a 3
dictionary containing details of vehicles – {Car_Name: Maker}.
The function should push the name of car manufactured by ‘TATA’
(including all the possible cases like Tata, TaTa, etc.) to the stack.
For example:
If the dictionary contains the following data :
Vehicle={"Santro":"Hyundai","Nexon":"TATA","Safari":"Tata"}
The stack should contain
Safari
Nexon
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #25/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
Ans stack=[]
def Push(Vehicle) :
for v_name in Vehicle :
if Vehicle[v_name].upper()=="TATA" :
stack.append(v_name)
OR
stack=[]
def Push(Vehicle) :
for v_name in Vehicle :
if Vehicle[v_name] in ("TATA", "TaTa","tata","Tata"):
stack.append(v_name)
OR
Any other valid Python code to serve the purpose.
(½ mark for defining correct function header)
(½ mark for correct loop )
(1 mark for checking the condition )
(1 mark for appending the data)
SECTION - D
31 Quickdev, an IT based firm, located in Delhi is planning to set up a network
for its four branches within a city with its Marketing department in Kanpur.
As a network professional, give solutions to the questions (i) to (v), after
going through the branches locations and other details which are given below:
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #26/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
(i) Suggest the most suitable place to install the server for the Delhi branch 1
with a suitable reason.
Branch D, as it has maximum number of computers
Ans OR any other location with valid justification
(½ mark for naming the Branch and ½ mark for correct justification)
(ii) Suggest an ideal layout for connecting all these branches within Delhi. 1
Ans
(iii) Which device will you suggest, that should be placed in each of these 1
branches to efficiently connect all the computers within these branches ?
Ans. Switch/Hub/Router
(1 mark for suggesting the correct device)
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #27/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
(iv) Delhi firm is planning to connect to its Marketing department in Kanpur which 1
is approximately 300 km away. Which type of network out of LAN, WAN or
MAN will be formed ? Justify your answer.
Ans. WAN – as the network is spread across different geographical locations of the
country.
(½ mark for writing the correct type of network)
(½ mark for correct justification)
(v) Suggest a protocol that shall be needed to provide help for transferring of 1
files between Delhi and Kanpur branch.
Ans. FTP
(1 mark for writing the correct answer as FTP)
OR
(1 mark for any other valid protocol that can be used to provide help
for transferring of files)
32 (a) What possible output(s) are expected to be displayed on screen at the time 2
of execution of the following program :
import random
M=[5,10,15,20,25,30]
for i in range(1,3):
first=random.randint(2,5)–1
sec=random.randint(3,6)–2
third=random.randint(1,4)
print(M[first], M[sec], M[third],sep="#")
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #28/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
(b) The code given below deletes the record from the table employee which 3
contains the following record structure:
E_code - String
E_name - String
Sal – Integer
City - String
Note the following to establish connectivity between Python and MySQL :
· Username is root
· Password is root
· The table exists in a MySQL database named emp.
· The details (E_code,E_name,Sal,City) are the attributes of the
table.
Write the following statements to complete the code :
Statement 1 – to import the desired library.
Statement 2 – to execute the command that deletes the record with
E_code as 'E101'.
Statement 3 – to delete the record permanently from the database.
mycursor=mydb.cursor()
_________________ # Statement 2
_________________ # Statement 3
print ("Record deleted")
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #29/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
OR
(b) The code given below reads the following records from the table employee
and displays only those records who have employees coming from city
‘Delhi’:
E_code – String
E_name - String
Sal - Integer
City - String
Note the following to establish connectivity between Python and MySQL :
• Username is root
• Password is root
• The table exists in a MySQL database named emp.
• The details (E_code,E_name,Sal,City) are the attributes
of the table.
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #30/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
Statement 1: mysql.connector
Ans. OR any other valid library used for
Python MySQL connectivity
Statement 2: mycursor.execute("select * from employee
where City='Delhi '")
Statement 3: mycursor.fetchall()
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #31/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
import csv
def COURIER_ADD() :
f1=open("courier.csv","a",newline="\n")
writ=csv.writer(f1)
cid=int(input("Enter the Courier id"))
s_name=input ("Enter the Sender Name")
Source=input("Enter the Source Address")
destination=input("Enter Destination Name")
detail=[cid,s_name,Source,destination]
writ.writerow (detail)
f1.close()
def COURIER_SEARCH() :
f1=open("courier.csv","r") # ignore newline
detail=csv.reader(f1)
name=input("Enter the Destination Name to be searched")
for i in detail :
if i[3]==name:
print("Details of courier are: ",i)
COURIER_ADD()
COURIER_SEARCH()
OR
Any other valid Python code to serve the purpose.
(1 mark for any one correct difference between CSV and Text file)
import csv
def Add_Book():
f1=open("Book.csv","a",newline="\n")
writ=csv.writer(f1)
book_ID=int(input("Enter the Book id"))
B_name=input("Enter the Book Name")
pub=input("Enter the Publisher Name")
detail=[book_ID, B_name,pub]
writ.writerow(detail)
f1.close()
Add_Book()
Search_Book()
OR
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #33/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
SECTION E
34 The school has asked their estate manager Mr. Rahul to maintain the data of
all the labs in a table LAB. Rahul has created a table and entered data of 5
labs.
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #34/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
35 Shreyas is a programmer, who has recently been given a task to write a user
defined function named write_bin() to create a binary file called
Cust_file.dat containing customer information – customer number (c_no),
name (c_name), quantity (qty), price (price) and amount (amt) of each
customer.
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #35/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
import pickle
def write_bin():
bin_file=_______ #Statement 1
while True:
c_no=int(input("enter customer number"))
c_name=input("enter customer name")
qty=int(input("enter qty"))
price=int(input("enter price"))
if ________ #Statement 2
print("Quantity less than 10..Cannot SAVE")
else:
amt=price * qty
c_detail=[c_no,c_name,qty,price,amt]
________ #Statement 3
ans=input("Do you wish to enter more records y/n")
if ans.lower()=='n':
________ #Statement 4
_________________ #Statement 5
______________________ #Statement 6
(i) Write the correct statement to open a file 'Cust_file.dat' for writing the data 1
of the customer.
Ans Statement 1: open ("Cust_file.dat", "wb")
(1 Mark for correctly writing missing Statement 1)
(ii) Which statement should Shreyas fill in Statement 2 to check whether quantity 1
is less than 10.
Ans Statement 2: qty<10 :
(1 Mark for correctly writing missing Statement 2)
(iii) Which statement should Shreyas fill in Statement 3 to write data to the binary 2
file and in Statement 4 to stop further processing if the user does not wish to
enter more records.
Ans Statement 3: pickle.dump(c_detail,bin_file)
Statement 4: break
(1 Mark for correctly writing missing Statement 3)
(1 Mark for correctly writing missing Statement 4)
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #36/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023
OR
(Option only for part (iii))
(iii) What should Shreyas fill in Statement 5 to close the binary file named 2
Cust_file.dat and in Statement 6 to call a function to write data in binary
file?
Ans Statement 5: bin_file.close()
Statement 6: write_bin()
(1 Mark for correctly writing missing Statement 5)
(1 Mark for correctly writing missing Statement 6)
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #37/37]