0% found this document useful (0 votes)
35 views

Ans Cs 2023

The document is a marking scheme for the Computer Science subject for Class XII. It provides general instructions for examiners evaluating answer books including: strictly following the marking scheme; awarding marks for novel but correct answers; ensuring accurate marking and totals; evaluating a minimum number of answer books per day; and maintaining confidentiality of the evaluation process and documents. Examiners are instructed to carefully and accurately evaluate answers according to the guidelines and value points in the marking scheme.
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)
35 views

Ans Cs 2023

The document is a marking scheme for the Computer Science subject for Class XII. It provides general instructions for examiners evaluating answer books including: strictly following the marking scheme; awarding marks for novel but correct answers; ensuring accurate marking and totals; evaluating a minimum number of answer books per day; and maintaining confidentiality of the evaluation process and documents. Examiners are instructed to carefully and accurately evaluate answers according to the guidelines and value points in the marking scheme.
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/ 37

MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 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.

2 “Evaluation policy is a confidential policy as it is related to the confidentiality of the


examinations conducted, Evaluation done and several other aspects. Its’ leakage to public
in any manner could lead to derailment of the examination system and affect the life and
future of millions of candidates. Sharing this policy/document to anyone, publishing in
any magazine and printing in News Paper/Website etc may invite action under various
rules of the Board and IPC.”

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.

11 A full scale of marks __________(example 0 to 80/70/60/50/40/30 marks as given in Question


Paper) has to be used. Please do not hesitate to award full marks if the answer deserves it.

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

1. State True or False. 1


“Identifiers are names used to identify a variable, function in a program”.
Ans True
(1 mark for writing correct answer)

2. Which of the following is a valid keyword in Python ? 1


(a) false (b) return
(c) non_local (d) none
Ans (b) return
(1 mark for writing correct answer)

3. Given the following Tuple 1


Tup= (10, 20, 30, 50)
Which of the following statements will result in an error ?
(a) print (Tup[0]) (b) Tup.insert (2, 3)
(c) print (Tup [1:2]) (d) print (len (Tup))
Ans (b) Tup.insert (2, 3)
(1 mark for writing correct answer)

4. Consider the given expression : 1


5<10 and 12>7 or not 7>4
Which of the following will be the correct output, if the given expression is
evaluated ?
(a) True (b) False
(c) NONE (d) NULL
Ans (a) True
(1 mark for writing correct answer)

5. Select the correct output of the code : 1


S= "Amrit Mahotsav @ 75"
A=S.partition (" ")
print (a)
(a) ('Amrit Mahotsav','@','75')
(b) ['Amrit','Mahotsav','@','75']
(c) ('Amrit', 'Mahotsav @ 75')
(d) ('Amrit','' , 'Mahotsav @ 75')
Ans (d) ('Amrit', '', 'Mahotsav @ 75')

[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #4/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023

(1 mark for writing correct answer)


OR
(1 mark for mentioning Error in code OR no correct option)
Note:
print(A) is wrongly typed as print(a)
6. Which of the following mode keeps the file offset position at the end of the 1
file ?
(a) r+ (b) r
(c) w (d) a
Ans (d) a
(1 mark for writing correct answer)

7. Fill in the blank. 1


_____ function is used to arrange the elements of a list in ascending order.
(a) sort() (b) arrange()
(c) ascending() (d) asort()
Ans (a) sort()
(1 mark for writing correct answer)

8. Which of the following operators will return either True or False ? 1


(a) += (b) !=
(c) = (d) *=
Ans (b) !=
(1 mark for writing correct answer)
OR
(1 mark for mentioning No option OR Error in question)

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

(a) Statement 2 (b) Statement 3


(c) Statement 4 (d) Statements 2 and 4
Ans (a) Statement 2
OR
(d) Statements 2 and 4
(1 mark for writing correct answer as (a))
OR
(1 mark for writing correct answer as (d))
OR
(1 mark for writing (a) and (c) as the correct answers)
OR
(Only ½ mark for writing (c) as the correct answer)

10. Fill in the blank. 1


_____ is a number of tuples in a relation.
(a) Attribute (b) Degree
(c) Domain (d) Cardinality
Ans (d) Cardinality
(1 mark for writing correct answer)

11. The syntax of seek () is : 1


file_object.seek (offset[, reference_point] )
What is the default value of reference_point ?
(a) 0 (b) 1
(c) 2 (d) 3
Ans (a) 0
(1 mark for writing correct answer)

[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #6/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023

12. Fill in the blank : 1


_______ clause is used with SELECT statement to display data in a sorted
form with respect to a specified column.
(a) WHERE (b) ORDER BY
(c) HAVING (d) DISTINCT
Ans (b) ORDER BY
(1 mark for writing correct answer)

13. Fill in the blank : 1


______ is used for point-to-point communication or unicast communication
such as radar and satellite.
(a) INFRARED WAVES (b) BLUETOOTH
(c) MICROWAVES (d) RADIOWAVES
Ans (c) MICROWAVES
OR
(d) RADIOWAVES
(1 mark for writing correct answer as (c) MICROWAVES)
OR
(1 mark for writing correct answer as (d) RADIOWAVES)

14. What will the following expression be evaluated to in Python ? 1


print(4+3*5/3–5%2)
(a) 8.5 (b) 8.0
(c) 10.2 (d) 10.0
Ans (b) 8.0
(1 mark for writing correct answer)

15. Which function returns the sum of all elements of a list ? 1


(a) count() (b) sum()
(c) total() (d) add()
Ans (b) sum()
(1 mark for writing correct answer)

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

Q. 17 and 18 are ASSERTION (A) and REASONING (R) based questions.


Mark the correct choice as
(a) Both (A) and (R) are true and (R) is the correct explanation for (A).
(b) Both (A) and (R) are true and (R) is not the correct explanation for (A).
(c) (A) is true but (R) is false.
(d) (A) is false but (R) is true.
17. Assertion (A) : To use a function from a particular module, we need to 1
import the module.
Reason (R) : import statement can be written anywhere in the program,
before using a function from that module.
Ans. (b) Both (A) and (R) are true and (R) is not the correct explanation for (A)
(1 mark for writing correct answer)
OR
(½ mark for writing (a) as the correct option)

18. Assertion (A): A stack is a LIFO structure. 1


Reason (R) : Any new element pushed into the stack always gets positioned
at the index after the last existing element in the stack
Ans (c) (A) is true but (R) is false.
(1 mark for writing (c) as the correct option)
OR
(1 mark for writing (b) as the correct option)
OR
(1 mark for writing (a) as the correct option)

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

Ans def max_num (L) :


max=L[0]
for a in L:
if a > max:
max=a
return max
(1½ marks for correcting all 3 mistakes)
(½ mark for underlining the corrections)
OR
(1 mark for correcting only 2 mistakes)
(½ mark for underlining the corrections)
OR
(½ mark for correcting only 1 mistake)
(½ mark for underlining the correction)

20. (a) Differentiate between wired and wireless transmission. 2

Ans In case of wired or guided transmission, there is a physical link made of


wire/cable through which data in terms of signals are propagated between
the nodes. These are usually metallic cable, fiber-optic cable, etc.

In case of wireless or unguided transmission, data travels in air in terms of


electromagnetic waves using an antenna. These are usually bluetooth,
microwaves, infrared, radio waves, etc.

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)

21. (a) Given is a Python list declaration : 1


Listofnames=["Aman","Ankit","Ashish","Rajan","Rajat"]
Write the output of :
print (Listofnames [–1:–4:–1])
Ans ['Rajat', 'Rajan', 'Ashish']

(1 mark for writing the correct output with/without formatting)


OR
(½ mark for mentioning the correct names -'Ashish', 'Rajan', 'Rajat'
but not in correct order)

(b) Consider the following tuple declaration : 1


tup1=(10,20,30,(10,20,30),40)
Write the output of :
print(tupl.index(20))
Ans 1
(1 mark for writing the correct output)

[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #10/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023

22. Explain the concept of ‘‘Alternate Key’’ in a Relational Database 2


Management System with an appropriate example.
Ans Alternate Keys are all the Candidate Keys of a RDBMS table, which have not
been used as a Primary Key.
Example:
RegNo AadhaarNo Name

123456 123456789012 Abraham Sen

123458 123456789123 Umeed Singh


In this example, any one of the RegNo and AadhaarNo can be used as a
Primary Key. If RegNo is used as the Primary Key then AadhaarNo is the
Alternate Key.

(2 mark for explaining Alternate Keys with example)


OR
(1 mark for writing example of Alternate Keys without any explanation)
OR
(1 mark only for writing the definition of Alternate Keys)

23. (a) Write the full forms of the following: 2


(i) HTML
(ii) TCP

Ans (i) HTML : Hyper Text Markup Language


(ii) TCP : Transmission Control Protocol
(½ mark for writing each of the two full forms)
(b) What is the need of Protocols ?
Ans Protocols are needed for communication between computers.
OR
any valid need/definition/explanation of protocol.
(1 mark for writing any one need OR definition OR explanation)

[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #11/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023

24. (a) Write the output of the code given below : 2


def short_sub (lst,n) :
for i in range (0,n) :
if len (lst)>4:
lst [i]=lst [i]+lst[i]
else:
lst[i]=lst[i]
subject=['CS','HINDI','PHYSICS','CHEMISTRY','MATHS']
short_sub(subject,5)
print(subject)

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

CHAR is of fixed length character(string) data type, which means, declaring


CHAR (10) implies to reserve spaces for 10 characters. If data does not have
10 characters (e.g., ‘CITY’ has four characters), MySQL fills the remaining 6
characters with spaces padded on the right.

VARCHAR is a variable-length character(string) data type. Declaring VARCHAR


(30) means a maximum of 30 characters can be stored but the actual
allocated bytes will depend on the length of the entered string. So ‘CITY’ in
VARCHAR (30) will occupy space needed to store 4 characters only and the
remaining 26 will be released.

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)

(½ Mark each for the two DDL commands)


(½ Mark each for the two DML commands)

[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

LOAN_NO B_NAME AMOUNT

L-170 DELHI 3000

L-230 KANPUR 4000

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

102 SAHIL KHAN KANPUR UTTAR PRADESH

104 SAMEER PARIKH ROOP NAGAR PUNJAB

105 MARY JONES DELHI DELHI

106 MAHIR SHARMA SONIPAT HARYANA

107 ATHARVA BHARDWAJ DELHI DELHI

108 VEDA SHARMA KANPUR UTTAR PRADESH

(i) SELECT F_NAME, CITY FROM WORKER ORDER BY STATE DESC;

Ans.
F_NAME CITY

SAHIL KANPUR

VEDA KANPUR

SAMEER ROOP NAGAR

MAHIR SONIPAT

MARY DELHI

ATHARVA DELHI

(½ Mark for writing the correct output)

[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #15/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023

(ii) SELECT DISTINCT (CITY) FROM WORKER;

Ans.
CITY

KANPUR

ROOP NAGAR

DELHI

SONIPAT

(½ Mark for writing the correct output)

(iii) SELECT F_NAME, STATE FROM WORKER WHERE L_NAME


LIKE '_HA%';
Ans.
F_NAME STATE

SAHIL UTTAR PRADESH

MAHIR HARYANA

ATHARVA DELHI

VEDA UTTAR PRADESH

(½ Mark for writing the correct output)

(iv) SELECT CITY, COUNT (*) FROM WORKER GROUP BY CITY;

[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

(½ Mark for writing the correct output)

Note for (i) to (iv) :


1. Ignore the output header and cases of the outputs
2. ½ mark for each query, for writing any 2 correct rows in the
output
3. Order of the output rows/columns should be ignored.

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 :

Once upon a time, there was a woodcutter


He lived in a little house in a beautiful, green wood.
One day, he was merrily chopping some wood.
He saw a little girl skipping through the woods, whistling
happily.
The girl was followed by a big gray wolf.

Then the function should display output as :

He lived in a little house in a beautiful, green wood.


He saw a little girl skipping through the woods, whistling
happily.

[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

any other valid Python code to serve the purpose.

[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #18/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023

(½ mark for the function header)


(½ mark for opening the file)
(½ mark for reading the file correctly)
(1 mark for checking the number of words in each line)
(½ mark for displaying the desired lines)

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

Ans. def count_Dwords():


with open ("Details.txt", 'r') as F: # ignore 'r'
S=F.read()
Wlist = S.split()
count = 0
for W in Wlist:
if W[-1].isdigit():
count+=1
print("Number of words ending with a digit are",count)

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

any other valid Python code to serve the purpose.

(½ mark for the function header)


(½ mark for opening the file)
(½ mark for reading the file correctly)
(1 mark for checking the condition)
(½ mark for displaying the desired lines)

28. (a) Write the outputs of the SQL queries (i) to (iv) based on the relations 2
COMPUTER and SALES given below :

Table : COMPUTER

PROD_ID PROD_NAME PRICE COMPANY TYPE

P001 MOUSE 200 LOGITECH INPUT

P002 LASER PRINTER 4000 CANON OUTPUT

P003 KEYBOARD 500 LOGITECH INPUT

P004 JOYSTICK 1000 IBALL INPUT

P005 SPEAKER 1200 CREATIVE OUTPUT

P006 DESKJET PRINTER 4300 CANON OUTPUT

[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

(i) SELECT MIN(PRICE), MAX(PRICE) FROM COMPUTER;


Ans.
MIN(PRICE) MAX(PRICE)

200 4300

(½ mark for correct output)

(ii) SELECT COMPANY, COUNT(*) FROM COMPUTER GROUP BY


COMPANY HAVING COUNT(COMPANY) > 1;
Ans.
COMPANY COUNT(*)

LOGITECH 2

CANON 2

(½ mark for correct output)


(iii) SELECT PROD_NAME, QTY_SOLD FROM COMPUTER C, SALES S
WHERE C.PROD_ID=S.PROD_ID AND TYPE = 'INPUT';
Ans.
PROD_NAME QTY_SOLD

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

(½ mark for correct output)


(iv) SELECT PROD_NAME, COMPANY, QUARTER FROM COMPUTER C,
SALES S WHERE C.PROD_ID=S. PROD_ID;

PROD_NAME COMPANY QUARTER

MOUSE LOGITECH 2

LASER PRINTER CANON 1

KEYBOARD LOGITECH 2

JOYSTICK IBALL 1

(½ mark for correct output)


(b) Write the command to view all databases. 1
Ans. SHOW DATABASES;

(1 mark for writing the correct command)


Note: punctuation mark (;) and cases can be ignored.

29. Write a function EOReplace() in Python, which accepts a list L of numbers. 3


Thereafter, it increments all even numbers by 1 and decrements all odd
numbers by 1.
Example :
If Sample Input data of the list is :
L=[10,20,30,40,35,55]
Output will be :
L=[11,21,31,41,34,54]
Ans. def EOReplace(L):
for i in range(len(L)):
if L[i]%2==0:
L[i]=L[i]+1
else:
L[i]=L[i]-1
print(L)

[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

any other valid Python code to serve the purpose.

(½ mark for correct function header)


(½ mark for getting the list)
(½ mark for correct loop)
(½ mark for checking the condition)
(½ mark for incrementing the even values)
(½ mark for decrementing the odd values)

[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #23/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023

30. (a) A list contains following record of customer : 3


[Customer_name, Room Type]
Write the following user defined functions to perform given operations on
the stack named 'Hotel' :
(i) Push_Cust() – To Push customers’ names of those customers who are
staying in ‘Delux’ Room Type.

(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:

Distance between various branches is as follows :

[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #26/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023

Number of computers in each of the branches :

(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

(Based on Server Location)


OR

(Based on minimum distance between branches)


(1 mark for correctly drawing any one valid layout)
OR
(1 mark for correctly suggesting name of any one valid topology)

(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="#")

(i) 10#25#15 (ii) 5#25#20


20#25#25 25#20#15
(iii) 30#20#20 (iv) 10#15#25#
20#25#25 15#20#10#

Ans. (i) 10#25#15


20#25#25

(2 marks for the correct answer)


(Deduct ½ mark each for any other additional option along with correct
option)

[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.

import __________ as mysql # Statement 1


def delete() :
mydb=mysql.connect(host="localhost",user="root",
passwd="root",database="emp")

mycursor=mydb.cursor()
_________________ # Statement 2
_________________ # Statement 3
print ("Record deleted")

Ans. Statement 1 : mysql.connector


OR any other valid library used for
Python MySQL connectivity
Statement 2: mycursor.execute("DELETE FROM employee
WHERE E_code='E101'")
Statement 3 : mydb.commit()

(1 mark for writing any valid library for Statement 1)


(½ mark for writing correct object & function name in Statement 2)
(½ mark for writing correct Query in Statement 2)
(½ mark for writing correct object name in Statement 3)
(½ mark for writing correct function name in Statement 3)

[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #29/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023

OR

(a) Predict the output of the code given below : 2


def makenew(mystr) :
newstr=""
count=0
for i in mystr :
if count%2!=0:
newstr=newstr+str(count)
else :
if i.lower():
newstr=newstr+i.upper()
else:
newstr=newstr+i
count+=1
print(newstr)
makenew("No@1")
Ans. N1@3

(½ mark for writing each correct character with or without formatting)

(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

Write the following statements to complete the code : 3


Statement 1 – to import the desired library.
Statement 2 – to execute the query that fetches records of the employees
coming from city ‘Delhi’.
Statement 3 – to read the complete data of the query (rows whose city is
Delhi) into the object named details, from the table employee in
the database.

import _____________ as mysql # Statement 1


def display():
mydb=mysql.connect(host="localhost",user="root",
passwd="root",database="emp")
mycursor=mydb.cursor()
____________________________ # Statement 2
details = ___________________ # Statement 3
for i in details:
print (i)

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

(1 mark for writing any valid library for Statement 1)


(½ mark for writing correct object & function name in Statement 2)
(½ mark for writing correct Query in Statement 2)
(½ mark for writing correct object name in Statement 3)
(½ mark for writing correct function name in Statement 3)

33 (a) Write one difference between CSV and text files. 5


Write a program in Python that defines and calls the following user defined
functions:
(i) COURIER_ADD() : It takes the values from the user and adds
the details to a csv file 'courier.csv'. Each record consists of
a list with field elements as cid, s_name, Source,
destination to store Courier ID, Sender name, Source and
destination address respectively.
(ii) COURIER_SEARCH() : Takes the destination as the input and
displays all the courier records going to that destination.

[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #31/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023

Ans CSV files


● can be viewed in spreadsheets
● module CSV has to be imported
Text files
● can be viewed in the text editor
● No specific module required to be imported
(any other valid difference - any one)

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)

(½ mark for correctly importing csv module)


(½ mark for opening in the file in right mode in COURIER_ADD())
(½ mark for reading values from the user)
(½ marks correct uses of writerow/writerows)
(½ mark for opening in the file in right mode in COURIER_SEARCH())
(½ marks correct uses of reader object)
(½ mark for displaying desired output)
(½ mark for correctly calling COURIER_ADD()
and COURIER_SEARCH())
OR
[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #32/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023

(b) Why is it important to close a file before exiting ?


Write a program in Python that defines and calls the following user defined
functions : 5
(i) Add_Book() : Takes the details of the books and adds them to a
csv file ‘Book.csv’. Each record consists of a list with field
elements as book_ID, B_name and pub to store book ID, book
name and publisher respectively.
(ii) Search_Book() : Takes publisher name as input and counts and
displays number of books published by them.
Ans It is important to close the file before exiting as Python makes sure that any
unwritten or unsaved data is flushed off to the file before it is closed.

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

def Search_Book ():


f1=open("Book.csv","r") # ignore newline
detail=csv.reader(f1)
name=input("Enter the Publisher Name to be searched")
pub_count=0
for i in detail :
if i[2]==name:
pub_count+=1
print("NUMBER OF BOOKS: ",pub_count)

Add_Book()
Search_Book()

OR

Any other valid Python code to serve the purpose.

[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #33/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023

(1 mark for writing correct purpose of closing a file)

(½ mark for correctly importing csv module)


(½ mark for opening in the file in right mode in Add_Book())
(½ mark for reading values from the user)
(½ marks correct uses of writerow/writerows)
(½ mark for opening in the file in right mode in Search_Book())
(½ marks correct uses of reader object)
(½ mark for displaying desired output)
(½ mark for correctly calling Add_Book() and Search_Book() )

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.

Based on the data given above, answer the following questions :

(i) Identify the columns which can be considered as Candidate keys. 1


Ans. Candidate keys: LABNO and LAB_NAME
(1 Mark for correctly writing both names of Candidate keys)
OR
(½ Mark for specifying any one candidate key correctly)

(ii) Write the degree and cardinality of the table. 1


Ans Degree = 5
Cardinality = 5
(½ Mark for writing value of Degree correctly)
(½ Mark for writing value of Cardinality correctly)

[Sub Code: 083 Series: HFG1E Paper Code: 91 SET-4] [Page #34/37]
MARKING SCHEME OF CLASS XII COMPUTER SCIENCE (083) - 2023

(iii) Write the statements to: 2


(a) Insert a new row with appropriate data.
(b) Increase the capacity of all the labs by 10 students which are on ‘I’
Floor.
Ans (a) INSERT INTO LAB
VALUES('L006','PHYSICS','RAVI',25,'II');

(b) UPDATE LAB SET CAPACITY=CAPACITY+10 WHERE FLOOR='I';

(½ Mark for writing the INSERT INTO LAB part correctly)


(½ Mark for writing the VALUES part correctly)

(½ Mark for writing the UPDATE LAB SET part correctly)


(½ Mark for writing the CAPACITY=CAPACITY+10 WHERE FLOOR="I"
part correctly)
OR
(Option for part (iii) only)
(iii) Write the statements to : 2
(a) Add the constraint PRIMARY KEY to a column LABNO in the table.
(b) Delete the table LAB.
Ans (a) ALTER TABLE LAB ADD PRIMARY KEY (LABNO);
(b) DROP TABLE LAB;
(a) (½ Mark for writing ALTER TABLE LAB part correctly)
(½ Mark for writing ADD PRIMARY KEY(LABNO) part correctly)

(b) (1 Mark for writing query correctly)

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.

The function accepts customer number, name, quantity and price.


Thereafter, it displays the message ‘Quantity less than 10 ….. Cannot SAVE’,
if quantity entered is less than 10. Otherwise the function calculates amount
as price * quantity and then writes the record in the form of a list into the
binary file.

[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)

Note: 'ab' mode also be considered

(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]

You might also like