0% found this document useful (0 votes)
33 views280 pages

Sample Pper Ak 2024

Uploaded by

suriaprabha1
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)
33 views280 pages

Sample Pper Ak 2024

Uploaded by

suriaprabha1
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/ 280

THE RAJAS INTERNATIONAL SCHOOL

OZHUGINASERY,NAGERCOIL – 629 001

(Affiliated to CBSE, Affiliation No:1930207)

ACADEMIC YEAR : 2024-25

COMPUTER SCIECNE

SUBJECT CODE:083

10 SAMPLE PAPERS
&
MARKING SCHEME

NAME : KAMALA PRIYA K T

SUBJECT: COMPUTER SCIENCE

SUB CODE: 083


MARKING SCHEME
Class: XII Session: 2024-25
Computer Science (083)

Time allowed: 3 Hours Maximum Marks: 70


Q No. SECTION A (21X1=21) Marks
1. False (1)
(1 mark for correct answer)
2. (A) #THONPROGRAM
(1)
(1 mark for correct answer)
3. (A) not (True) and False
(1)
(1 mark for correct answer)
4. (B) ['I', 'ter', 'atio', 'al']
(1)
(1 mark for correct answer)
5. ce lo
(1)
(1 mark for correct answer)
6. (B) False
(1)
(1 mark for correct answer)
7. (B) print(my_dict['apple', 'banana'])
(1)
(1 mark for correct answer)
8. (B) Removes the first occurrence of value x from the list
(1)
(1 mark for correct answer)
9. (C) 3
(1)
(1 mark for correct answer)
10. file.seek(0) ( OR file.seek(0,0) )
(1)
(1 mark for correct answer)
11. False
(1)
(1 mark for correct answer)
12. (C) 12#15%
(1)
(1 mark for correct answer)
13. Alter (or Alter Table) (1)
(1 mark for correct answer)

Page: 1/11
14. (A) Details of all products whose names start with 'App'
(1)
(1 mark for correct answer)
15. (D) CHAR
(1)
(1 mark for correct answer)
16. (B) count()
(1)
(1 mark for correct answer)
17. (B) FTP
(1)
(1 mark for correct answer)
18. (B) Gateway
(1)
(1 mark for correct answer)
19. (B) Packet Switching
(1)
(1 mark for correct answer)
20. (C) A is True but R is False.
(1)
(1 mark for correct answer)
21. (C) A is True but R is False.
(1)
(1 mark for correct answer)

Q No. SECTION B (7 X 2 =14) Marks


22. A mutable object can be updated whereas an immutable object cannot be
updated.
Mutable object: [1,2] or {1:1,2:2} (Any one)
(2)
Immutable object: (1,2) or ‘123’ (Any one)
(1 mark for correct difference)
(½ x 2 = 1 Mark for selecting correct objects)
23. (I) Arithmetic operators: +,-

(II) Relational operators: >, >= (2)

(½ x 4 = 2 Marks for each correct operator)


24. (I)
A) L1.count(4)
OR
B) L1.sort() (2)
(1 mark for correct answer)

Page: 2/11
(II)
A) L1.extend(L2)
OR
B) L2.reverse()
(1 mark for correct answer)
25. (A), (C)
(½ x 2 = 1 Mark)
(2)
Minimum and maximum possible values of the variable b: 1,6
(½ x 2 = 1 Mark)
26. def swap_first_last(tup):
if len(tup) < 2:
return tup
new_tup = (tup[-1],) + tup[1:-1] + (tup[0],)
return new_tup
(2)

result = swap_first_last((1, 2, 3, 4))


print("Swapped tuple:", result)

(½ mark each for correcting 4 mistakes)


27. (I)
A) UNIQUE
OR
B) NOT NULL
(1 mark for correct answer)
(2)
(II)
A) ALTER TABLE MOBILE DROP PRIMARY KEY;
OR
B) ALTER TABLE MOBILE ADD PRIMARY KEY (M_ID);
(1 mark for correct answer)
28. A) Advantage: Network extension is easy.

Disadvantage: Failure of switch/hub results in failure of the network.


(1 mark for correct Advantage)
(2)
(1 mark for correct Disadvantage)

OR

Page: 3/11
B) SMTP: Simple Mail Transfer Protocol.

SMTP is used for sending e-mails from client to server.


(1 mark for correct expansion)
(1 mark for correct usage)

Q No. SECTION C (3 X 3 = 9) Marks


29. (A)

def show():
f=open("Email.txt",'r')
data=f.read()
words=data.split()
for word in words:
if '@cmail' in word:
print(word,end=' ')
f.close()
(½ mark for correct function header)
(½ mark for correctly opening the file)
(½ mark for correctly reading from the file)
(½ mark for splitting the text into words)
(1 mark for correctly displaying the desired words) (3)
OR
(B)
def display_long_words():
with open("Words.txt", 'r') as file:
data=file.read()
words=data.split()
for word in words:
if len(word)>5:
print(word,end=' ')
(½ mark for correct function header)
(½ mark for correctly opening the file)
(½ mark for correctly reading from the file)
( ½ mark for splitting the text into words)
(1 mark for correctly displaying the desired words)

Page: 4/11
30. (A)
(I)
def push_book(BooksStack, new_book):
BooksStack.append(new_book)
(II)
def pop_book(BooksStack):
if not BooksStack:
print("Underflow")
else:
return(BookStack.pop())
(III)
def peep(BooksStack):
if not BooksStack:
print("None")
else:
print(BookStack[-1])
(3x1 mark for correct function body; No marks for any function header as it
was a part of the question)
OR
(B)
def push_even(N):
(3)
EvenNumbers = []
for num in N:
if num % 2 == 0:
EvenNumbers.append(num)
return EvenNumbers

VALUES = []

for i in range(5):
VALUES.append(int(input("Enter an integer: ")))

EvenNumbers = push_even(VALUES)

def pop_even():
if not EvenNumbers:
print("Underflow")
else:
print(EvenNumbers.pop())

pop_even()

Page: 5/11
def Disp_even():
if not EvenNumbers:
print("None")
else:
print(EvenNumbers[-1])
Disp_even()
(1/2 for identifying even numbers)
(1/2 mark for correctly adding data to stack)
(1/2 mark for correctly poping data on the stack and 1/2 mark for checking
condition)
(1/2 mark for correctly displaying the data with none)
(1/2 mark for function call statements)
31. (A) 15@
7@
9

OR
(3)
(B) 1 #2 #3#
1 #2 #3 #
1#

(1 mark for each correct line of output)


(deduct ½ mark for not printing @/#)

Q No. SECTION D (4 X 4 = 16) Marks


32. (A)
(I) select Product, sum(Quantity) from orders group by product
having sum(Quantity)>=5;
(II) select * from orders order by Price desc;
(III) select distinct C_Name from orders;
(IV) select sum(price) as total_price from orders where Quantity IS
NULL;

(4 x 1 mark for each correct query)


(4)
OR
(B)
(I)

C_Name | Total_Quantity
--------- |---------------
Jitendra |1
Mustafa |2
Dhwani |1

Page: 6/11
(II)

O_Id | C_Name | Product | Quantity | Price


----- |-------- |------------ |---------- |-------
1002 | Mustafa | Smartphone | 2 | 10000
1003 | Dhwani | Headphone | 1 | 1500

(III) O_Id | C_Name | Product | Quantity | Price


----- |---------- |------------ |---------- |-------
1001 | Jitendra | Laptop |1 | 12000
1002 | Mustafa | Smartphone | 2 | 10000
1003 | Dhwani | Headphone | 1 | 1500

(IV)
MAX(Price)
-----------
12000

(4 x 1 mark for each correct output)


33. (I)
def show():
import csv
f=open("happiness.csv",'r')
records=csv.reader(f)
next(records, None) #To skip the Header row
for i in records:
if int(i[1])>5000000:
print(i)
f.close()
(½ mark for opening in the file in right mode)
(½ mark for correctly creating the reader object)
(½ mark for correctly checking the condition)
(½ mark for correctly displaying the records) (4)

(II)
def Count_records():
import csv
f=open("happiness.csv",'r')
records=csv.reader(f)
next(records, None) #To skip the Header row
count=0
for i in records:
count+=1
print(count)
f.close()

Page: 7/11
(½ mark for opening in the file in right mode)
(½ mark for correctly creating the reader object)
(½ mark for correct use of counter)
(½ mark for correctly displaying the counter)
Note (for both parts (I) and (II)):
(i) Ignore import csv as it may be considered the part of the
complete program, and there is no need to import it in individual
functions.
(ii) Ignore next(records, None) as the file may or may not have the
Header Row.
34. (I) Select * from FACULTY natural join COURSES where Salary<12000;
Or
Select * from FACULTY, COURSES where Salary<12000 and
facuty.f_id=courses.f_id;
(II) Select * from courses where fees between 20000 and 50000;
(III) Update courses set fees=fees+500 where CName like
'%Computer%';
(IV)
(A) Select FName, LName from faculty natural join courses where
Came="System Design"; (4)
Or
Select FName, LName from faculty, courses where Came="System
Design" and facuty.f_id=courses.f_id;

OR

(B) Select * from FACULTY, COURSES;

(4x1 mark for each correct query)


35. def AddAndDisplay():
import mysql.connector as mycon
mydb=mycon.connect(host="localhost",user="root",
passwd="Pencil",database="ITEMDB")
mycur=mydb.cursor()
no=int(input("Enter Item Number: "))
nm=input("Enter Item Name: ")
pr=float(input("Enter price: "))
qty=int(input("Enter qty: "))
query="INSERT INTO stationery VALUES ({},'{}',{},{})" (4)
query=query.format(no,nm,pr,qty)
mycur.execute(query)
mydb.commit()
mycur.execute("select * from stationery where price>120")
for rec in mycur:
print(rec)

Page: 8/11
(½ 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


36. (I) (5)
import pickle

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:

Page: 9/11
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. (I) ADMIN Block as it has maximum number of computers. (5)
(1 mark for correct answer)

(II) Switch
(1 mark for correct answer)

(III)

Page: 10/11
(or Any other correct layout)
Cable: Coaxial cable
(½ mark for correct layout + ½ mark for correct table type)

(IV) There is no requirement of the Repeat as the optical fibre cable used for
the network can carry the data to much longer distances than within the
campus.
(1 mark for correct answer)

(V) (A) a) Video Conferencing


OR
(B) LAN
(1 mark for correct answer)

Page: 11/11
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]
Strictly Confidential: (For Internal and Restricted use only)
Senior School Certificate Examination
September 2020
Marking Scheme – Computer Science (NEW) (SUBJECT CODE: 083)
(SERIES: HMJ/C, PAPER CODE – 91/C, SET 4​)
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 the teaching profession. To avoid mistakes, it is
requested that before starting evaluation, you must read and understand the spot evaluation
guidelines carefully. Evaluation is a 10 -12 days mission for all of us. Hence, it is necessary that
you put in your best efforts in this process.
2. 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 the
latest information or knowledge and/or are innovative, they may be assessed for their
correctness otherwise and marks be awarded to them.
3. 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. 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.
4. 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.
5. If a question does not have any parts, marks must be awarded in the left hand margin and encircled.
6. If a student has attempted an extra question, answer of the question deserving more marks should be
retained and the other answer scored out.
7. No marks to be deducted for the cumulative effect of an error. It should be penalized only once.
8. A full scale of marks 70 (example: 1-70) has to be used. Please do not hesitate to award full marks if
the answer deserves it.
9. Every examiner has to necessarily do evaluation work for full working hours i.e. 8 hours every day and
evaluate 25 answer books per day.
10. Ensure that you do not make the following common types of errors committed by the Examiner in the
past:-
a. Leaving the answer or part thereof unassessed in an answer book.
b. Giving more marks for an answer than assigned to it.
c. Wrong transfer of marks from the inside pages of the answer book to the title page.
d. Wrong question wise totaling on the title page.
e. Wrong totaling of marks of the two columns on the title page.
f. Wrong grand total.
g. Marks in words and figures not tallying.
h. Wrong transfer of marks from the answer book to online award list.
i. 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.)
j. Half or a part of answer marked correct and the rest as wrong, but no marks awarded.
11. While evaluating the answer books if the answer is found to be totally incorrect, it should be marked
as (X) and awarded zero (0) Marks.
12. Any unassessed 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.
13. The Examiners should acquaint themselves with the guidelines given in the Guidelines for spot
Evaluation before starting the actual evaluation.
14. 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.

[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #1/16]
15. The Board permits candidates to obtain a photocopy of the Answer Book on request in an RTI
application and also separately as a part of the re-evaluation process on payment of the processing
charges.

Specific Instructions:
● All programming questions have to be answered with respect to C++ Language / Python
only
● In C++ / Python, ignore case sensitivity for identifiers (Variable / Functions / Structures /
Class Names)
● In Python indentation is mandatory, however, the number of spaces used for indenting
may vary
● In SQL related questions – both ways of text/character entries should be acceptable for
Example: “AMAR” and ‘amar’ both are acceptable.
● In SQL related questions – all date entries should be acceptable for Example:
‘YYYY-MM-DD’, ‘YY-MM-DD’, ‘DD-Mon-YY’, “DD/MM/YY”, ‘DD/MM/YY’, “MM/DD/YY”,
‘MM/DD/YY’ and {MM/DD/YY} are correct.
● In SQL related questions – semicolon should be ignored for terminating the SQL
statements
● In SQL related questions, ignore case sensitivity.

SECTION A
Q1 (a) Which of the following is ​not a valid variable name in Python. Justify reason for [1]
it not being a valid name:
(i) 5Radius (ii)Radius_ (iii) _Radius (iv) Radius
Ans (i) 5Radius

Reason:​ variable name in Python cannot start with a digit


(½ Mark for writing correct option)
(½ Mark for writing correct reason)
(b) Which of the following are keywords in Python: [1]
(i) break (ii) check (iii) range (iv) while
Ans (i) break
(iii) range
(iv) while

Any two options out of (i), (iii), (iv)


(½ Mark for writing each correct option)
(c) Name the Python Library modules which need to be imported to invoke the [1]
following functions:
(i) cos() (ii) randint()
Ans (i) ​math (ii) random
(½ Mark for writing each correct Python Library Module name)
(d) Rewrite the following code in python after removing all syntax error(s). [2]
Underline each correction done in the code.
input('Enter a word',W)
if W = 'Hello'
print('Ok')
else:
print('Not Ok')

[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #2/16]
Ans W=input('Enter a word')​ //Error 1
if W ​ == ​ 'Hello' ​: ​ //Error 2,Error 3
print('Ok')
else​ : //Error 4
print('Not Ok')
(½ Marks for writing correction for Error 1)
(½ Marks for writing correction for Error 2
(½ Marks for writing correction for Error 3)
(½ Marks for writing correction for Error 4)
NOTE:
(1 mark for only identifying all the errors without writing corrections)
(e) Find and write the output of the following python code: [2]
def ChangeVal(M,N):
for i in range(N):
if M[i]%5 == 0 :
M[i] //= 5
if M[i]%3 == 0 :
M[i] //= 3

L=[ 25,8,75,12]
ChangeVal(L,4)
for i in L :
print(i, end='#')
Ans 5#8#5#4#
(½ Mark for writing each correct value)
OR
(Only ½ Mark for writing all ‘#’ at proper places)
Note:
● Deduct only ½ Mark for not considering any or all correct placements of #
(f) Find and write the output of the following python code: [3]
def Call(P=40,Q=20):
P=P+Q
Q=P-Q
print(P,'@',Q)
return P

R=200
S=100
R=Call(R,S)
print (R,'@',S)
S=Call(S)
print(R,'@',S)

Ans 300 @ 200


300 @ 100
120 @ 100
300 @ 120

[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #3/16]
(1½ Mark for writing each correct 2 lines of output)
NOTE:
Deduct only ½ Mark for not considering any or all line break
(g) What possible outputs(s) are expected to be displayed on screen at the time of [2]
execution of the program from the following code? Also specify the minimum
and maximum values that can be assigned to the variable End .
import random
Colours = ["VIOLET","INDIGO","BLUE","GREEN",
"YELLOW","ORANGE","RED"]
End = randrange(2)+3
Begin = randrange(End)+1
for i in range(Begin,End):
print(Colours[i],end="&")

(i) ​INDIGO&BLUE&GREEN& (ii) ​VIOLET&INDIGO&BLUE&


(iii) ​BLUE&GREEN&YELLOW& (iv) ​GREEN&YELLOW&ORANGE&

Ans (i) ​INDIGO&BLUE&GREEN&


Minimum Value of ​End​ = 3
Maximum Value of ​End = ​ 4

(1 Mark for writing correct option)


(½ Mark for writing Minimum Value of Stop)
(½ Mark for writing Maximum Value of Stop)

Q2 (a) Write the names of the immutable data objects from the following: [1]
(i) List (ii) Tuple (iii) String (iv) Dictionary
Ans (ii) Tuple (iii) String
(½ Mark for writing each correct option)
(b) Write a Python statement to declare a Dictionary named ​ClassRoll with Keys [1]
as 1,2,3 and corresponding values as ​'Reena', 'Rakesh', 'Zareen'
respectively.
Ans ClassRoll = {1:"Reena", 2:"Rakesh", 3:"Zareen"}
(1 Mark for writing correct declaration statement)
(c) Which of the option out of (i) to (iv) is the correct data type for the [1]
variable ​Vowels​ as defined in the following Python statement:

Vowels = ('A', 'E', 'I', 'O', 'U')


(i) List (ii) Dictionary (iii)Tuple (iv) Array
Ans (iii)Tuple
(1 Mark for writing correct option)
(d) Write the output of the following Python code: [1]
for i in range(2,7,2):
print(i * '$')
Ans $$
$$$$
$$$$$$

[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #4/16]
(1 Mark for writing correct output)
(e) Write the output of the following Python code: [1]
def Update(X=10):
X += 15
print( 'X = ', X)
X=20
Update()
print( 'X = ', X)
Ans X = 25
X = 20
(½ Mark for writing each correct line of output)
(f) Differentiate between “w” and “r” file modes used in Python while opening a [2]
data file. Illustrate the difference using suitable examples.
Ans A file is opened using “w” mode to write content into the file.
A file is opened using “r” mode to read content into the file.
Example:
def Create():
file=open('NOTES.TXT','w')
S="This is a sample"
file.write(S)
file.close()

def Read():
file=open('NOTES.TXT','r')
Lines=file.readline();
print(Lines)
file.close()

Create();
Read();
(½ Mark for writing correct usage of ’w’ mode)
(½ Mark for writing correct usage of ’r’ mode)
(g) A pie chart is to be drawn(using pyplot) to represent Pollution Level of Cities. [2]
Write appropriate statements in Python to provide labels for the pie slices as
the names of the Cities and the size of each pie slice representing the
corresponding Pollution of the Cities as per the following table:
Cities Pollution
Mumbai 350
Delhi 475
Chennai 315
Bangalore 390

Ans import matplotlib.pyplot as plt


Cities = ['Mumbai','Delhi','Chennai','Bangalore']
Pollution = [350,475,315,390]
plt.pie(Pollution, labels=Cities)
plt.show()
(1 Mark for writing correct import statement)
[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #5/16]
(1 Mark for writing plt.pie statement with correct parameters)
OR
Write the output from the given python code:
import matplotlib.pyplot as plt
Months = ['Dec', 'Jan', 'Feb', 'Mar']
Attendance = [70, 90, 75, 95]
plt.bar(Months, Attendance)
plt.show()

Ans

(½ Mark for writing correct Labels of X axis)


(½ Mark for writing correct scaling of Y axis)
(1 Mark for drawing all the 4 bars correctly)
(h) Write a function ​Show_words() in python to read the content of a text file [2]
'NOTES.TXT' and display the entire content in capital letters. Example, if the
file contains:
"This is a test file"
Then the function should display the output as:
THIS IS A TEST FILE
Ans def Show_words():
file=open('NOTES.TXT','r')
Lines = file.readlines()
for L in Lines:
print(L.upper())
file.close()
(½ Mark for correctly opening the file)
(½ Mark for reading all lines)
(½ Mark for correct loop to iterate for each line)
(½ Mark for displaying each line in uppercase)
OR

Write a function ​Show_words() in python to read the content of a text file


'NOTES.TXT' and display only such lines of the file which have exactly 5
words in them. Example, if the file contains:
"This is a sample file.
The file contains many sentences.
But need only sentences which have only 5 words."
Then the function should display the output as:
This is a sample file.

[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #6/16]
The file contains many sentences.
Ans def Show_words():
file=open('NOTES.TXT','r')
Lines = file.readlines()

for L in Lines:
W=L.split()
if (len(W)==5):
print(L)
file.close()
(½ Mark for correctly opening the file)
(½ Mark for reading all lines)
(½ Mark for correct loop to iterate for each line)
(½ Mark for displaying each line having 5 words in it)
(i) Write a Recursive function in Python ​RecsumNat(N)​, to return the sum of [3]
the first N natural numbers. For example, if N is 10 then the function
should return (1 + 2 + 3 + ... + 10 = 55).
Ans def RecsumNat(N):
if N==1:
return N
else:
return N+RecsumNat(N-1)
(1 Mark for checking the recursion termination condition)
(1 Mark for returning correct value on recursion termination)
(1 Mark for returning correct value on recursion)
OR
Write a Recursive function in Python ​Power(X,N)​, to return the result of X
raised to the power N where X and N are non-negative integers. For example, if
X is 5 and N is 3 then the function should return the result of(5)​3​ i.e. ​125
Ans def Power(X,N):
if N==1:
return X
else:
return X*Power(X,N-1)
(1 Mark for checking the recursion termination condition)
(1 Mark for returning correct value on recursion termination)
(1 Mark for returning correct value on recursion)
(j) Write functions in Python for PushS(List) and for PopS(List) for performing Push [4]
and Pop operations with a stack of List containing integers.
Ans def PushS(List):
N=int(input("Enter integer"))
List.append(N)

def PopS(List):
if (List==[]):
print("Stack empty")
else:
print ("Deleted integer :",List.pop())

[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #7/16]
(½ Mark for writing correct PushS() header)
(½ Mark for writing correct input for integer)
(½ Mark for adding the entered integer into the List)
(½ Mark for writing correct PopS() header)
(½ Mark for checking empty list condition)
(½ Mark for displaying “Stack empty”)
(1 Mark for displaying and deleting value from the list)
OR
Write functions in Python for InsertQ(Names) and for RemoveQ(Names) for
performing insertion and removal operations with a queue of List which
contains names of students.
Ans def InsertQ(Names):
Name=input("enter Name to be inserted: ")
List.append(Name)

def DeleteQ(Names):
if (Names==[]):
print("Queue empty")
else:
print ("Deleted integer is: ",Names[0])
del(Names[0])
(½ Mark for writing correct InsertQ header)
(½ Mark for accepting a name from user)
(½ Mark for adding the entered name in the List)
(½ Mark for writing correct DeleteQ header)
(½ Mark for checking empty queue condition)
(½ Mark for displaying “Queue empty”)
(½ Mark for displaying the name to be deleted)
(½ Mark for deleting name from the List)
SECTION B

Q3 Questions 3 (a) to 3 (d): Fill in the blanks:

(a) Computers connected by a network across different cities is an example of [1]


_______________.
Ans MAN or Metropolitan Area Network

(1 mark for writing the correct missing word)

(b) _________ is a network tool used to test the download and upload broadband [1]
speed.
Ans Speedtest

(1 mark for writing the correct missing word)

(c) A _________________ is networking device that connects computers in a [1]


network by using packet switching to receive, and forward data to the
destination
Ans Switch

(1 mark for writing the correct missing word)

(d) _______________ is a network tool used to determine the path packets take [1]

[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #8/16]
from one IP address to another.
Ans Traceroute

(1 mark for writing the correct missing word)

(e) Write the full form of the following abbreviations: [2]


(i) POP
(ii) VoIP
(iii) NFC
(iv) FTP
Ans (i) POP : Post Office Protocol
(ii) VoIP : Voice Over Internet Protocol
(iii) NFC : Near-field communication
(iv) FTP : File Transfer Protocol
(½ Mark for writing each correct expansion)

(f) Match the ServiceNames listed in the first column of the following table with [2]
their corresponding features listed in the second column of the table:
Technology Feature
1G ● IP based Protocols (LTE)
● True Mobile Broadband
2G ● Improved Data Services with Multimedia
● Mobile Broadband
3G ● Basic Voice Services
● Analog-based protocol
4G ● Better Voice Services
● Basic Data Services
● First digital standards (GSM,CDMA)

Ans ServiceName Feature


1G ● Basic Voice Services
● Analog-based protocol
2G ● Better Voice Services
● Basic Data Services
● First digital standards (GSM,CDMA)

3G ● Improved Data Services with Multimedia


● Mobile Broadband
4G ● IP based Protocols (LTE)
● True Mobile Broadband

(½ Mark for writing each correct match)

(g) What is a secure communication? Differentiate between HTTP and HTTPS. [3]

Ans Secure communication is when two entities are ​communicating and do not
want a third party to listen in.
The primary difference between HTTP (Hypertext Transfer Protocol) and HTTPS
(Hypertext Transfer Protocol Secure) is that HTTP is not secure whereas HTTPS
is a secure protocol which uses TLS/SSL certificate to ensure the authentication.
(1 mark for writing correct explanation of Secure Communication)
(1 mark for writing correct explanation HTTP)
(1 mark for writing correct explanation HTTPS)

[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #9/16]
(h) Helping Hands is an NGO with its head office at Mumbai and branches located at [4]
Delhi, Kolkata and Chennai. Their Head Office located at Delhi needs a
communication network to be established between the head office and all the
branch offices. The NGO has received a grant from the national government for
setting up the network. The physical distances between the branch offices and
the head office and the number of computers to be installed in each of these
branch offices and the head office are given below. You as a network expert
have to suggest the best possible solutions for the queries as raised by the NGO.
as given in (i) to (iv).
Distances between various locations in Kilometres:
Mumbai H.O. to Delhi 1420
Mumbai H.O. to Kolkata 1640
Mumbai H.O. to Chennai 2710
Delhi to Kolkata 1430
Delhi to Chennai 1870
Chennai to Kolkata 1750

Number of Computers installed at various locations are as follows:


Mumbai H.O 2500
Delhi branch 1200
Kolkata branch 1300
Chennai branch 1100

(i) Suggest by drawing the best cable layout for effective network connectivity
of all the Branches and the Head Office for communicating data.

[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #10/16]
Ans

(1 Mark for drawing the correct layout)

(ii) Suggest the most suitable location to install the main server of this NGO to
communicate data with all the offices.
Ans MUMBAI H.O.

(1 Mark for writing the correct location)

(iii) Write the name of the type of network out of the following, which will be
formed by connecting all the computer systems across the network:
(A) WAN (B)MAN (C) LAN (D) PAN
Ans (A) WAN

(1 Mark for writing the correct option)

(iv) Suggest the most suitable medium for connecting the computers installed
across the network out of the following:
(A) Optical Fibre (B) Telephone wires (C) Radio Waves (D) Ethernet cable

Ans (A) Optical Fibre

(1 Mark for writing the correct option)

SECTION C

Q4 (a) Which SQL command is used to add a new attribute in a table? [1]

Ans ALTER TABLE

(1 Mark for writing the correct SQL command)

(b) Which SQL aggregate function is used to count all records of a table ? [1]

Ans COUNT(*)

(1 Mark for writing the correct aggregate function)

(c) Which clause is used with a ​SELECT ​command in SQL to display the records in [1]
ascending order of an attribute?
Ans ORDER BY

(1 Mark for writing the correct clause)

[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #11/16]
(d) Write the full form of the following abbreviations: [1]
(i) DDL (ii) DML
Ans (i) DDL : Data Definition Language
(ii) DML : Data Manipulation Language
(½ Mark for writing correct full form of DDL)
(½ Mark for writing correct full form of DML)
(e) Observe the following table EMPLOYEES and DEPARTMENT carefully and answer [2]
the questions that follow:

TABLE: EMPLOYEES TABLE: DEPARTMENT


ENO ENAME DOJ DNO DNO DNAME
E1 NUSRAT 2001-11-21 D3 D1 ACCOUNTS
E2 KABIR 2005-10-25 D1 D2 HR
D3 ADMIN

(i) What is the Degree of the table EMPLOYEES ? What is the cardinality of the
table DEPARTMENT?
Ans Degree of the table EMPLOYEES = 4
Cardinality of the table DEPARTMENT = 3
(½ Mark for writing correct Degree of the table EMPLOYEES)
(½ Mark for writing correct Cardinality of the table DEPARTMENT)
(ii) What is a Primary Key ? Explain.

Ans A Primary Key is an attribute of a Table which has a unique value for
each of the records and can be used to identify a record of the table.

OR
Any equivalent explanation conveying the correct explanation for a
Primary Key
(1 Mark for writing the correct explanation for Primary Key)

OR
Differentiate between Selection and Projection operations in context of a
Relational Database. Also, illustrate the difference with one supporting
example of each.
Ans Selection ​: Operation upon a relation to select a horizontal subset of
the relation.
Projection : Operation upon a relation to select a vertical subset of the
relation.
Example:
TABLE: EMPLOYEES
ENO ENAME DOJ DNO
E1 NUSRAT 2001-11-21 D3
E2 KABIR 2005-10-25 D1

A selection upon Employees for tuples whose DOJ is in the year 2005 will result
into

[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #12/16]
TABLE: EMPLOYEES
ENO ENAME DOJ DNO
E2 KABIR 2005-10-25 D1
A projection upon Employees for ENAME and DOJ of all Employees will result
into
TABLE: EMPLOYEES
ENAME DOJ
NUSRAT 2001-11-21
KABIR 2005-10-25

(½ mark for writing each correct explanation of Selection and Projection)


(½ mark for writing each correct example of Selection and Projection)
(f) Write whether the following statements are True or False for the GET and POST [2]
methods in Django
(i) ​POST requests are never cached
(ii) ​GET requests do not remain in the browser history
Ans (i) True
(ii) False
(1 mark for writing True for statement (i))
(1 mark for writing False for statement (ii))
(g) Write outputs for SQL queries (i) to (iii), which are based on the following [3]
tables CUSTOMERS and PURCHASES

Table: CUSTOMERS Table: PURCHASES


CNO CNAME CITIES SNO QTY PUR_DATE CNO
C1 SANYAM DELHI S1 15 2018-12-25 C2
C2 SHRUTI DELHI S2 10 2018-11-10 C1
C3 MEHER MUMBAI S3 12 2018-11-10 C4
C4 SAKSHI CHENNAI S4 7 2019-01-12 C7
C5 RITESH INDORE S5 11 2019-02-12 C2
C6 RAHUL DELHI S6 10 2018-10-12 C6
C7 AMEER CHENNAI S7 5 2019-05-09 C8
C8 MINAKSHI BANGALORE S8 20 2019-05-09 C3
C9 ANSHUL MUMBAI S9 8 2018-05-09 C9
S10 15 2018-11-12 C5
S11 6 2018-08-04 C7

(i) SELECT COUNT(DISTINCT CITIES) FROM CUSTOMERS;

Ans COUNT(DISTINCT CITIES)


5
(½ Mark for writing correct output with or without column headings)

(ii) SELECT MAX(PUR_DATE) FROM PURCHASES;

[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #13/16]
Ans MAX(PUR_DATE)
2019-05-09
(½ Mark for writing correct output with or without column headings)

(iii) SELECT CNAME, QTY, PUR_DATE FROM CUSTOMERS, PURCHASES


WHERE CUSTOMERS.CNO = PURCHASES.CNO AND QTY IN
(10,20);
Ans CNAME​ ​QTY​ ​PUR_DATE
SANYAM 10 2018-11-10
RAHUL 10 2018-10-12
MEHER 20 2019-05-09
(½ Mark for writing correct output with or without column headings)

(h) Write SQL queries for (i) to (iv), which are based on the tables: CUSTOMERS and [4]
PURCHASES given in the question 4(g):
(i) To display details of all CUSTOMERS whose CITIES are neither Delhi nor
Mumbai
Ans SELECT * FROM CUSTOMERS WHERE CITIES NOT
IN('DELHI','MUMBAI');
OR
SELECT * FROM CUSTOMERS WHERE CITIES<>'DELHI' AND
CITIES<>'MUMBAI';

(½ Mark for correct SELECT statement)


(½ Mark for correct WHERE clause)
(ii) To display the CNAME and CITIES of all CUSTOMERS in ascending order of
their CNAME.
Ans SELECT CNAME, CITIES FROM CUSTOMERS ORDER BY CNAME;

(½ Mark for correct SELECT statement)


(½ Mark for correct ORDER BY clause)
(iii) To display the number of CUSTOMERS along with their respective CITIES in
each of the CITIES.
Ans SELECT COUNT(*), CITIES FROM CUSTOMERS GROUP BY CITIES;

(½ Mark for correct SELECT statement)


(½ Mark for correct GROUP BY clause)
(iv) To display details of all PURCHASES whose Quantity is more than 15.

Ans SELECT * FROM PURCHASES WHERE QTY>15;

(½ Mark for correct SELECT statement)


(½ Mark for correct WHERE clause)
SECTION D
5 (a) An organisation purchases new computers every year and dumps the old ones [1]
into the local dumping yard. Write the name of the most appropriate category
of waste that the organisation is creating every year, out of the following
options:
(A) Solid Waste (B) Commercial Waste (C) E-Waste (D) Business Waste

[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #14/16]
Ans (C) E-Waste
(1 Mark for writing the correct option)
(b) Data which has no restriction of usage and is freely available to everyone under [1]
Intellectual Property Rights is categorised as:
(A) Open Source (B) Open Data (C) Open Content (D) Open Education
Ans (B) Open Data
(1 Mark for writing the correct option)
(c) What is a Unique Id? Write the name of the Unique Identification provided by [2]
Government of India for Indian Citizens.
Ans Unique identifier (UID) is any identifier which is guaranteed to be unique among
all objects and is used for identifying various objects.
The Unique Identification provided by the Government of India for Indian
Citizens is ​Aadhaar.
(1 Mark for writing the correct explanation for Unique Id)
(1 Mark for writing the correct name of the Unique Id)
(d) Consider the following scenario and answer the questions which follow: [2]
“A student is expected to write a research paper on a topic. The
student had a friend who took a similar class five years ago. The
student asks his older friend for a copy of his paper and then takes
the paper and then submits the entire paper as his own research work

(i) Which of the following activities appropriately categorises the act of the
writer:
(A) Plagiarism (B) Spamming (C) Virus (D) Phishing

(ii) Which kind of offense out of the following is made by the student?
(A) Cyber Crime (B) Civil Crime (C) Violation of Intellectual Property
Rights
Ans (i) (A) Plagiarism
(ii) (C) Violation of Intellectual Property Rights
(1 Mark for writing the correct option)
(1 Mark for writing the correct option)
(e) What are Digital Rights? Write examples for two digital rights applicable to [2]
usage of digital technology.
Ans Digital Rights: ​The right and freedom to use all types of digital technology in an
acceptable and appropriate manner as well as the right to privacy and the
freedom of personal expression while using any digital media.
Examples: (Any two)
Right of privacy for personal data existing with private organisations.
Right to access the Internet without tampering upon speed or bandwidth.
Right to un-tweaked information on news channels and social media.
Right to any kind of access to content on the web.
Right to downloads or uploads.
Right to unrestricted communication methods (email, chat, IM, etc.).
OR
Any other 2 correct examples of digital rights
(1 Mark for writing the correct explanation for Digital Rights)
(½ Mark for writing each correct example of a digital right)
(f) Suggest techniques which can be adopted to impart Computer Education for: [2]
[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #15/16]
(i) Visually impaired students (someone who cannot write).
(ii) Speech impaired students (someone who cannot speak).
Ans (i) For visually impaired or blind users, programs like JAWS read any text out
loud. Screen-magnification programs assist partially sighted computer users.
Braille keyboards or pointers attached to the mouth, finger, head or knee
can also be used.
(ii) ​Software such as speech synthesizer enables non-verbal persons to convey
virtually any thought in their minds by providing them an 'artificial voice'.
(1 mark for writing correct suggestion for visually impaired students )
(1 mark for writing correct suggestion for speech impaired students )

[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #16/16]
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

General Instructions:
● The answers given in the marking scheme are SUGGESTIVE. Examiners are
requested to award marks for all alternative correct Solutions/Answers
conveying the similar meaning
● All programming questions have to be answered with respect to C++ Language /
Python only
● In C++ / Python, ignore case sensitivity for identifiers (Variable / Functions /
Structures / Class Names)
● In Python indentation is mandatory, however, number of spaces used for
indenting may vary
● In SQL related questions – both ways of text/character entries should be
acceptable for Example: “AMAR” and ‘amar’ both are acceptable.
● In SQL related questions – all date entries should be acceptable for Example:
‘YYYY-MM-DD’, ‘YY-MM-DD’, ‘DD-Mon-YY’, “DD/MM/YY”, ‘DD/MM/YY’,
“MM/DD/YY”, ‘MM/DD/YY’ and {MM/DD/YY} are correct.
● In SQL related questions – semicolon should be ignored for terminating the SQL
statements
● In SQL related questions, ignore case sensitivity.
SECTION A - (Only for candidates, who opted for C++)
1 (a) Write the type of C++ tokens (keywords and user defined identifiers) from the 2
following:
(i) ​else​ (ii) ​Long​ (iii) ​4Queue​ (iv) ​_count

Ans (i) keyword (ii) Identifier (iii) None (iv) Identifier


NOTE: Ignore (iii)
(Full 2 Marks for ALL correct answers - (i), (ii) and (iv))
(1½ Mark for any TWO correct answers out of (i), (ii) and (iv))
(1 Mark for any ONE correct answer out of (i), (ii) and (iv))

(b) The following C++ code during compilation reports errors as follows: 1
Error: ‘ofstream’ not declared
Error: ‘strupr’ not declared
Error: ‘strcat’ not declared
Error: ‘FIN’ not declared
Write the names of the correct header files, which must be included to compile
the code successfully:
void main()
{
ofstream FIN("WISH.TXT");
char TEXT2[]="good day";
char TEXT1[]="John!";

strupr(TEXT2);
strcat(TEXT1, TEXT2);
FIN<<TEXT1<<endl;
}

Page #1/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

Ans (i) fstream (ii) string

(½ Mark for writing each correct answer)


NOTE: Any other header file to be ignored

(c) Rewrite the following C++ code after removing any/all syntactical errors with 2
each correction underlined.
Note​: Assume all required header files are already included in the program.
Typedef Count int;
void main()
{
Count C;
cout<<"Enter the count:";
cin>>C;
for (K = 1; K<=C; K++)
cout<< C "*" K <<endl;
}

Ans typedef​ ​int Count​; //Error 1, Error 2


void main()
{
Count C;
​int K;​ //OR ​Count K;​ //Error 3
cout<<"Enter the count:";
cin>>C;
for (K = 1; K<=C; K++)
//​OR​ for (​int​ K = 1; K<=C; K++) //Error 3
//​OR ​for (​Count​ K = 1; K<=C; K++) //Error 3
cout<< C ​<< ​"*" ​<< ​K <<endl; //Error 4
//​OR​ cout<<​C * K​<<endl; //Error 4
}

(½ Mark for correcting each correct Error)


NOTE:
(1 Mark for only identifying all the errors correctly)

(d) Find and write the output of the following C++ program code: 3
Note​: Assume all required header files are already included in the program.
void Revert(int &Num, int Last=2)
{
Last=(Last%2==0)?Last+1:Last-1;
for(int C=1; C<=Last; C++)
Num+=C;
}

Page #2/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

void main()
{
int A=20,B=4;
Revert(A,B);
cout<<A<<"&"<<B<<endl;
B--;
Revert(A,B);
cout<<A<<"#"<<B<<endl;
Revert(B);
cout<<A<<"#"<<B<<endl;
}

Ans 35&4
38#3
38#9

(½ Mark for writing each correct value)


OR
(Only ½ Mark for writing all ‘&’ and ‘#’ at proper places)
Note:
● Deduct only ½ Mark for not considering any or all correct
placements of & and #
● Deduct only ½ Mark for not considering any or all line break

(e) Find and write the output of the following C++ program code: 2
Note​: Assume all required header files are already included in the program.
#define Modify(N) N*3+10
void main()
{
int LIST[]={10,15,12,17};
int *P=LIST, C;
for(C=3; C>=0; C--)
LIST[I]=Modify(LIST[I]);
for (C=0; C<=3; C++)
{
cout<<*P<<":";
P++;
}
}

Ans Considering ​LIST[I]​ being replaced with ​LIST[C]


40:55:46:61:

(½ Mark for writing each correct value)


Note:
● Deduct ½ Marks if the values are written in reverse order
● Full 2 marks for writing ​"​undeclared variable ​I"/"​Error​"​ / ​"​No
Output"​ ​. ​Ignore output if the error is mentioned.

Page #3/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

(f) Look at the following C++ code and find the possible output(s) from the options 2
(i) to (iv) following it. Also, write the highest and lowest values that can be
assigned in the array A.
Note​:
● Assume all the required header files are already being included in the code.
● The function random(n) generates an integer between 0 and n-1.
void main()
{
randomize();
int A[4], C;
for(C=0; C<4; C++)
A[C]=random(C+1)+10;
for(C=3; C>=0; C--)
cout<<A[C]<<"@";
}
(i) (ii)
13@10@11@10@ 15$14$12$10$
(iii) (iv)
12@11@13@10@ 12@11@10@10@

Ans (i) and (iv)


A​Min​ = 10 A​Max​ = 13

(1 Mark for writing the correct options)


OR
(½ Mark for writing only option (i) OR only option (iv))
NOTE: No marks to be awarded for writing any other option or any other
combination

(½ Mark for writing each correct Maximum and Maximum value in array A)

2. (a) Which function(s) out of the following can be considered as overloaded 2


function(s) in the same program? Also, write the reason for not considering the
other(s) as overloaded function(s).
void Execute(char A,int B); //Function 1
void Execute(int A,char B); //Function 2
void Execute(int P=10); //Function 3
void Execute(); //Function 4
int Execute(int A); //Function 5
void Execute(int &K); //Function 6

Ans Option [i]


Functions 1,2,3 are overloaded

Reason: Function 4,5,6 would give ambiguity for Function 3


OR Any equivalent valid reason
OR

Page #4/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

Option [ii]
Functions 1,2,4,5 are overloaded

Reason: Function 3 and 6 not considered in this case because it would give
redeclaration error for Function 5
OR Any equivalent valid reason

OR
Option [iii]
Functions 1,2,4,6 are overloaded

Reason: Function 3 and 5 not considered in this case because it would give
redeclaration error for Function 6
OR Any equivalent valid reason

(Full 2 Marks for any of the Options [i] / [ii] / [iii])

NOTE:
● Deduct ½ Mark for not stating the reason
● 1 Mark for partially correct answer

OR
(1 Mark for writing only any 2 Functions from Options [i] / [ii] / [iii])
(1½ Mark for writing only any 3 Functions from Options [ii] / [iii])

(b) Observe the following C++ code and answer the questions (i) and (ii).
Note​: Assume all necessary files are included.
class FIRST
{
int Num1;
public:
void Display() //Member Function 1
{
cout<<Num1<<endl;
}
};
class SECOND: public FIRST
{
int Num2;
public:
void Display() //Member Function 2
{
cout<<Num2<<endl;
}
};
void main()
{

Page #5/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

SECOND S;
___________________ //Statement 1
___________________ //Statement 2
}

(i) Which Object Oriented Programming feature is illustrated by the definitions of 1


classes FIRST and SECOND?

Ans Inheritance
OR
Encapsulation
OR
Data Abstraction
OR
Data Hiding

(1 Mark for writing any correct OOP feature from the given answers)

(ii) Write Statement 1 and Statement 2 to execute Member Function 1 and Member 1
Function 2 respectively using the object S.

Ans S.FIRST::Display()​ //Statement 1


S.Display()​ //Statement 2
OR
S.SECOND::Display()​ //Statement 2
(½ Mark for writing correct Statement 1)
(½ Mark for writing correct Statement 2)

(c) Write the definition of a class CONTAINER in C++ with the following description: 4
Private Members
- Radius,Height // float
- Type // int (1 for Cone,2 for Cylinder)
- Volume // float
- CalVolume() // Member function to calculate
// volume as per the Type
Type Formula to calculate Volume
1 3.14*Radius*Height
2 3.14*Radius*Height/3

Public Members
- GetValues() // A function to allow user to enter value
// of Radius, Height and Type. Also, call
// function CalVolume() from it.
- ShowAll() // A function to display Radius, Height,
// Type and Volume of Container

Ans class CONTAINER

Page #6/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

{
float Radius, Height;
int Type;
float Volume;
void CalVolume();
public:
void GetValues();
void ShowAll();
};

void CONTAINER::GetValues()
{
cin>>Radius>>Height>>Type ;
CalVolume();
}

void CONTAINER::ShowAll()
{
cout<<Radius<<Height<<Type<<Volume<<endl;
}
OR
void CONTAINER::CalVolume() void CONTAINER::CalVolume()
{ {
if (Type == 1) switch (Type)
Volume=3.14*Radius*Height; {
else if (Type == 2) case 1:
Volume=3.14*Radius*Height/3; Volume =3.14*Radius*Height;
} break;
case 2:
Volume=3.14*Radius*Height/3;
}
}

(½ Mark for declaring class header correctly)


(½ Mark for declaring data members correctly)
(1 Mark for defining CalVolume() correctly)
(½ Mark for taking inputs of Radius, Type and Height in GetValues())
(½ Mark for invoking CalVolume() inside GetValues())
(½ Mark for defining ShowAll() correctly)
(½ Mark for correctly closing class declaration with a semicolon ; )
NOTE:
● Marks to be awarded for defining the member functions inside or
outside the class
● Marks not to be deducted for replacing the Formulae for calculating

Page #7/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

the Volumes with correct Formulae

(d) Answer the questions (i) to (iv) based on the following: 4


class Teacher
{
int TCode;
protected:
char Name[20];
public:
Teacher();
void Enter(); void Show();
};
class Course
{
int ID;
protected:
Char Title[30];
public:
Course();
void Initiate();
void Display();
};
class Schedule: public Course, private Teacher
{
int DD,MM,YYYY;
public:
Schedule();
void Start();
void View();
};
void main()
{
Schedule S;
}
(i) Which type of Inheritance out of the following is illustrated in the above example?
Single Level Inheritance, Multilevel Inheritance, Multiple Inheritance
Ans Multiple Inheritance

(1 Mark for writing correct option)

(ii) Write the names of all the members, which are directly accessible by the member
function View() of class Schedule.
Ans Start(), DD, MM, YYYY
Display(), Initiate(), Title
Enter(), Show(), Name
View() // Optional
(1 Mark for writing all correct member names )

Page #8/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

NOTE:
● Marks not to be awarded for partially correct answer
● Ignore the mention of Constructors
(iii) Write the names of all the members, which are directly accessible by the object S
of class Schedule declared in the main() function.
Ans View(), Start()
Display(), Initiate()
(1 Mark for writing all correct member names )
NOTE:
● Marks not to be awarded for partially correct answer
● Ignore the mention of Constructors
(iv) What will be the order of execution of the constructors, when the object S of class
Schedule is declared inside main() function?
Ans Course(), Teacher(), Schedule()

(1 Mark for writing correct order)


NOTE:
● No Marks to be awarded for any other combination/order.
● Names of the constructor/class without parentheses is acceptable
3 (a) Write the definition of a function SumEO(int VALUES[], int N) in C++, which 2
should display the sum of even values and sum of odd values of the array
separately.
Example: if the array VALUES contains
25 20 22 21 53

Then the functions should display the output as:


Sum of even values = 42 (i.e 20+22)
Sum of odd values = 99 (i.e 25+21+53)

Ans void SumEO(int VALUES[], int N)


{
int SE = 0, SO = 0;
​ for (int I=0;I<N;I++)
{
if(VALUES[I] %2 == 0)
SE += VALUES[I];
else
SO += VALUES[I];
}
cout<< "Sum of even values = " << SE<<endl;
cout<< "Sum of odd values = " << SO<<endl;
}
OR
Any other correct alternative code in C++
(½ Mark for correctly writing the loop)
(½ Mark for adding even elements)

Page #9/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

(½ Mark for adding odd elements)


(½ Mark for displaying the sum of even and odd elements)
(b) Write definition for a function ​UpperHalf(int Mat[4][4]) in C++, which displays the 3
elements in the same way as per the example shown below.
For example, if the content of the array Mat is as follows:
25 24 23 22
20 19 18 17
15 14 13 12
10 9 8 7
The function should display the content in the following format:
25 24 23 22
20 19 18
15 14
10

Ans void UpperHalf(int Mat[4][4])


{
for (int I=0;I<4;I++)
{
for (int J=0;J<4-I;J++)
cout<<MAT[I][J]<< " " ;
cout<<endl;
}
}
OR
void UpperHalf(int Mat[4][4])
{
for (int I=0;I<4;I++)
{
for (int J=0;J<4;J++)
if ((I+J)<=3)
cout<<MAT[I][J]<< " " ;
cout<<endl;
}
}
OR
Any other correct alternative code in C++
(½ Mark for correctly writing loop for traversing rows)
(½ Mark for correctly writing loop for traversing columns in each row)
(1 Mark for correctly checking elements for display)
(½ Mark for correctly displaying the selected elements)
(½ Mark for correctly displaying line break after each row)

(c) Let us assume Data[20][15] is a two dimensional array, which is stored in the 3
memory along the row with each of its element occupying 2 bytes, find the

Page #10/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

address of the element Data[10][5], if the element Data[15][10] is stored at the


memory location 15000.

Ans LOC(Data[10][5]) = LOC(Data[15][10])+2(15*(10-15)+(5-10))


= 15000 + 2((-75) + (-5))
= 15000 + 2(-80)
= 15000 - 160
= 14840
OR

LOC(Data[I][J]) = Base(Data)+W*(NC*(I-LBR)+(J-LBC))
Taking LBR=0, LBC=0
LOC(Data[15][10]) = Base(Data)+2*(15*15+10)
15000 = Base(Data)+2*(15*15+10)
Base(Data) = 15000 - 2*(235)
Base(Data) = 15000 - 470
Base(Data) = 14530

LOC(Data[10][5])= 14530 + 2*(10*15+5)


= 14530 + 2*(155)
= 14530 + 310
= 14840
OR

LOC(Data[I][J]) = Base(Data)+W*(NC*(I-LBR)+(J-LBC))
Taking LBR=1, LBC=1
LOC(Data[15][10]) = Base(Data)+2*(15*14+9)
15000 = Base(Data)+2*(15*14+9)
Base(Data) = 15000 - 2*(219)
Base(Data) = 15000 - 438
Base(Data) = 14562

LOC(Data[10][5])= 14562 + 2*(15*9+4)


= 14562 + 2*(139)
= 14562 + 278
= 14840
(1 Mark for writing correct formula (for Row major)
OR substituting formula with correct values)
(1 Mark for correct step calculations)
(1 Mark for final correct address)

NOTE:
● Marks to be awarded for calculating the address taking LBR and LBC = 1
(d) Write the definition of a member function AddPacket() for a class QUEUE in C++, 4
to remove/delete a Packet from a dynamically allocated QUEUE of Packets
considering the following code is already written as a part of the program.
struct Packet
{
int PID;
Page #11/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

char Address[20];
Packet *LINK;
};
class QUEUE
{
Packet *Front, *Rear;
public:
QUEUE(){Front=NULL;Rear=NULL;}
void AddPacket();
void DeletePacket();
~QUEUE();
};
Ans void QUEUE::AddPacket()
{
if(Front != NULL)
{
Packet *T;
T=Front;
cout<<Front->PID<<Front->Address<<" removed"<<endl;
//OR cout<<T->PID<<T->Address<<" removed"<<endl;
Front = Front->LINK;
delete T;
if (Front==NULL)
Rear=NULL;
}
else
cout<< "Queue Empty"<<endl;
}
OR
Any other equivalent code in C++
(1 Mark for checking EMPTY condition)
(½ Mark for declaring Packet T)
(½ Mark for assigning Front to T)
(½ Mark for deleting the previous Front Packet)
(½ Mark for changing LINK of Front)
(1 Mark for reassigning Rear with NULL if Queue becomes empty on
deletion)
NOTE:
● Marks should not be deducted if function header is written as
void QUEUE::DeletePacket()​instead of
void QUEUE::AddPacket()
● 4 Marks to be awarded if Addition of Packet is done in place of
Deletion according to the following distribution
● ( 1 Mark for creating a new Packet)
● ( ½ Mark for entering data for the new Packet)
● ( ½ Mark for assigning NULL to link of the new Packet)
● ( ½ Mark for assigning Front to the first Packet as Front = T)

Page #12/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

● ( ½ Mark for linking the last Packet to the new Packet as


Rear->LINK =T)
● ( 1 Mark for assigning Rear to the new Packet as Rear = T)
(e) Convert the following Infix expression to its equivalent Postfix expression, showing 2
the stack contents for each step of conversion:
U * V + (W - Z) / X
Ans ((U * V) + ((W - Z) / X))
INFIX STACK POSTFIX
U U
* * U
V * UV
) UV*
+ + UV*
W UV*W
- + - UV*W
Z + - UV*WZ
) + UV*WZ-
/ + / UV*WZ-
X + / UV*WZ-X
) + UV*WZ-X/
) UV*WZ-X/+
OR
U * V + (W - Z) / X
INFIX STACK POSTFIX
U U
* * U
V * UV
+ + UV*
( +( UV*
W +( UV*W
- +(- UV*W
Z +(- UV*WZ
) + UV*WZ-
/ +/ UV*WZ-
X +/ UV*WZ-X
UV*WZ-X/+

(½ Mark for conversion upto each operator illustrating through stack)


OR

Page #13/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

(1 Mark for only the final answer as ​UV*WZ-X/+ ​)


4. (a) A text file named ​MATTER.TXT contains some text, which needs to be displayed 3
such that every next character is separated by a symbol ‘#’.

Write a function definition for ​HashDisplay​() in C++ that would display the entire
content of the file ​MATTER.TXT​ in the desired format.
Example:
If the file MATTER.TXT has the following content stored in it:
THE WORLD IS ROUND

The function ​HashDisplay​() should display the following content:


T#H#E# #W#O#R#L#D# #I#S# #R#O#U#N#D#
Ans void HashDisplay()
{
char ch;
ifstream F("MATTER.TXT" );
while(F.get(ch))
cout<<ch<<'#';
F.close(); //IGNORE
}
OR
Any other correct function definition

(1 Mark for opening ​MATTER.TXT​ correctly)


(1 Mark for reading each character ​(using any method)​ from the file)
(½ Mark for displaying the character)
(½ Mark for displaying a # following the character)
(b) Write a definition for function TotalTeachers( ) in C++ to read each object of a 2
binary file SCHOOLS.DAT, find the total number of teachers, whose data is stored
in the file and display the same. Assume that the file SCHOOLS.DAT is created
with the help of objects of class SCHOOLS, which is defined below:
class SCHOOLS
{
int SCode; // School Code
char SName[20]; // School Name
int NOT; // Number of Teachers in the school
public:
void Display()
{cout<<SCode<<"#"<<SName<<"#"<<NOT<<endl;}
int RNOT(){return NOT;}
};
Ans void TotalTeachers()
{
ifstream F;
F.open("SCHOOLS.DAT",ios::binary);

Page #14/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

int Count=0;
SCHOOLS S;

while(F.read((char*)&S,sizeof(S)))
Count += S.RNOT();

cout<<"Total number of teachers :"<<Count<<endl;


F.close(); //IGNORE
}
OR
void TotalTeachers()
{
ifstream F;
F.open("SCHOOLS.DAT",ios::binary);
SCHOOLS S;
while(F.read((char*)&S,sizeof(S)))
cout<<S.RNOT()<<endl;//OR S.Display();
F.close(); //IGNORE
}
OR
Any other correct function definition
(½ Mark for opening ​SCHOOLS.DAT​ correctly)
(½ Mark for reading each record​ from the file)

(½ Mark for finding Total number of teachers)


(½ Mark for displaying Total number of teachers)
OR
(1 mark for displaying number of teachers in Each Record)
(c) Find the output of the following C++ code considering that the binary file 1
SCHOOLS.DAT exists on the hard disk with the following records of 10 schools of
the class SCHOOLS as declared in the previous question (4 b).
SCode SName NOT
1001 Brains School 100
1003 Child Life School 115
1002 Care Share School 300
1006 Educate for Life School 50
1005 Guru Shishya Sadan 195
1004 Holy Education School 140
1010 Rahmat E Talim School 95
1008 Innovate Excel School 300
1011 Premier Education School 200
1012 Uplifted Minds School 100
void main()
{

Page #15/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

fstream SFIN;
SFIN.open("SCHOOLS.DAT",ios::binary|ios::in);
SCHOOLS S;
SFIN.seekg(5*sizeof(S));
SFIN.read((char*)&S, sizeof(S));
S.Display();
cout<<"Record :"<<SFIN.tellg()/sizeof(S) + 1<<endl;
SFIN.close();
}
Ans 1004#Holy Education School#140
Record :7
(½ Mark for displaying correct values of Record 6 )
(½ Mark for displaying correct value of SFIN.tellg()/sizeof(B) + 1)

SECTION B - [Only for candidates, who opted for Python]


1 (a) Differentiate between Syntax Error and Run-Time Error? Also, write a suitable 2
example in Python to illustrate both.
Ans Syntax error​: An error of language resulting from code that does not conform to
the syntax of the programming language.
Example
a = 0
while a < 10 ​# : is missing as per syntax
a = a + 1
print a
Runtime error​: A runtime error is an error that causes abnormal termination of
program during running time..
Example
A=10
B=​int(raw_input("Value:"))
print A/B
# If B entered by user is 0, it will be run-time error
( ½ mark each for defining syntax error and run-time error )
( ½ mark for each correct example)
OR
( Full 2 Marks for illustrating both through examples)
(b) Name the Python Library modules which need to be imported to invoke the 1
following functions:
(i) ​sin()​ (ii) ​search​()

Ans (i) ​math​ (ii) ​re

(½ Mark for writing each correct Library module)

Note: Ignore any other Library modules, if mentioned.

Page #16/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

(c) Rewrite the following code in python after removing all syntax error(s). Underline 2
each correction done in the code.
Val = int(rawinput("Value:"))
Adder = 0

for C in range(1,Val,3)
Adder+=C
if C%2=0:
Print C*10
Else:
print C*
print Adder
Ans Val = int(raw_input("Value:")) # Error 1
Adder = 0

for C in range(1,Val,3)​ : ​ # Error 2


Adder+=C
if C%2==0:​ # Error 3
print C*10 # Error 4
else:​ # Error 5
print C ​ # Error 6
print Adder

OR
Corrections mentioned as follows:
raw_input in place of rawinput
: to be placed in for
== in place of =
print in place of Print
else in place of Else
C* is invalid, replaced by a suitable integer or C
(½ Mark for each correction, not exceeding 2 Marks)
OR
(1 mark for identifying the errors, without suggesting corrections)
(d) Find and write the output of the following python code: 2

Data = ["P",20,"R",10,"S",30]
Times = 0
Alpha = ""
Add = 0
for C in range(1,6,2):
Times= Times + C

Page #17/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

Alpha= Alpha + Data[C-1]+"$"


Add = Add + Data[C]
print Times,Add,Alpha
Ans 1 20 P$
4 30 P$R$
9 60 P$R$S$
( 1 Mark for each correct line of output)

Note:
● ½ Mark deduction for not considering all line changes
(e) Find and write the output of the following python code: 3

class GRAPH:
def __init__(self,A=50,B=100):
self.P1=A
self.P2=B
def Up(self,B):
self.P2 = self.P2 - B
def Down(self,B):
self.P2 = self.P2 + 2*B
def Left(self,A):
self.P1 = self.P1 - A
def Right(self,A):
self.P1 = self.P1 + 2*A
def Target(self):
print "(",self.P1.":",self.P2,")"
G1=GRAPH(200,150)
G2=GRAPH()
G3=GRAPH(100)
G1.Left(10)
G2.Up(25)
G3.Down(75)
G1.Up(30)
G3.Right(15)
G1.Target()
G2.Target()
G3.Target()
Ans ( 190 : 120 )
( 50 : 75 )
( 130 : 250 )
( 1 mark for each correct line of output)
OR
( Full 3 marks to be awarded if ​"E ​ o Output​"​ in
​ rror​"​ / ​"N
print "(",self.P1.":",self.P2,")" is mentioned)

Note:
● Deduct ½ Mark for not writing any or all ':' / '(' / ')' symbol(s)
Page #18/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

● Deduct ½ Mark for not considering any or all line breaks at proper
place(s)
(f) What possible outputs(s) are expected to be displayed on screen at the time of 2
execution of the program from the following code? Also specify the maximum
values that can be assigned to each of the variables BEGIN and LAST.
import random
POINTS=[20,40,10,30,15];
POINTS=[30,50,20,40,45];

BEGIN=random.randint(1,3)
LAST=random.randint(2,4)
for C in range(BEGIN,LAST+1):
print POINTS[C],"#",

(i) ​20#50#30# (ii) ​20#40#45#


(iii) ​50#20#40# (iv) ​30#50#20#

Ans (ii) 20#40#45# and (iii) 50#20#40#

Max value for BEGIN 3


Max value for LAST 4

(1 Mark for writing the correct options)


OR
(½ Mark for writing only option (ii))
OR
(½ Mark for writing only option (iii))
OR
(Full 2 Marks to be awarded if “ERROR”/ “NO OUTPUT” mentioned)

NOTE: No marks to be awarded for writing any other option or any other
combination

(½ Mark for writing correct Maximum value of BEGIN)


(½ Mark for writing correct Maximum value of LAST)

2 (a) What is the advantage of super() function in inheritance? Illustrate the same with 2
the help of an example in Python.
Ans In Python, super() function is used to call the methods of base class which have
been extended in derived class.
class person(object):
def __init__(self,name,age):
self.name=name
self.age=age
def display(self):

Page #19/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

print self,name, self.Age


class student(person):
def __init__(self,name,age,rollno,marks):
super(student,self)._init_(self, name, age)
self.rollno=rollno
self.marks=marks
def getRoll(self):
print self.rollno, self.marks
(1 mark for mentioning the advantage, 1 mark for writing any suitable
example)
(b) class Vehicle: #Line 1 2
Type = 'Car' #Line 2
def __init__(self, name): #Line 3
self.Name = name #Line 4
def Show(self): #Line 5
print self.Name,Vehicle.Type #Line 6

V1=Vehicle("BMW") #Line 7
V1.Show() #Line 8
Vehicle.Type="Bus" #Line 9
V2=Vehicle("VOLVO") #Line 10
V2.Show() #Line 11
(i) What is the difference between the variable in Line 2 and Line 4 in the above
Python code?
Ans The variable in Line 2 is a class attribute. This belongs to the class itself.
These attributes will be shared by all the instances.
The variable in Line 4 is an instance attribute. Each instance creates a
separate copy of these variables.
(1 mark for correct difference)

(ii) Write the output of the above Python code.

Ans BMW Car


VOLVO Bus
(½ for writing each correct line of output)

(c) Define a class CONTAINER in Python with following specifications 4

Instance Attributes
- Radius,Height # Radius and Height of Container
- Type # Type of Container
- Volume # Volume of Container

Page #20/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

Methods
- CalVolume() ​# To​ calculate volume
# as per the Type of container
# With the formula as given below:
Type Formula to calculate Volume

1 3.14 * Radius * Height

3 3.14 * Radius * Height/3

- GetValue() # To allow user to enter values of


# Radius, Height and Type.
# Also, this method should call
# CalVolume() to calculate Volume
- ShowContainer()# To display Radius, Height, Type
# Volume of the Container
Ans class CONTAINER: # class CONTAINER():/class CONTAINER(Object):
def __init__(self): # def __init__(self,R,H,T,V):
self.Radius=0 # self.Radius=R
self.Height=0 # self.Height=H
self.Type =0 # self.Type=T
self.Volume=0 # self.Volume=V

def CalVolume(self):
if self.Type == 1:
self.Volume = 3.14 * self.Radius * self.Height
elif self.Type ==3:
self.Volume = 3.14 * self.Radius * self.Height /3
def GetValue(self):
self.Radius = input("Enter Radius")
self.Height = input("Enter Height")
self.Type = input("Enter type")
self.CalVolume() # OR CalVolume(self)
def ShowContainer(self):
print self.Radius
print self.Height
print self.Type
print self.Volume
(½ Mark for correct syntax for class header)
(½ Mark for correct declaration of instance attributes)
(1 Mark for correct definition of CalVolume() function)
(1 Mark for correct definition of GetValue() with proper invocation of
CalVolume( ))
(1 Mark for correct definition of ShowContainer())

Page #21/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

NOTE:
● Deduct ½ Mark if CalVolume() is not invoked properly inside NewBox()
function
● Marks not to be deducted for replacing the Formulae for calculating
the Volumes with correct Formulae
(d) Answer the questions (i) to (iv) based on the following: 4
Class Top1(object):
def __init__(self,tx): #Line 1
self.X=tx #Line 2
def ChangeX(self,tx):
self.X=self.X+tx
def ShowX(self):
print self.X

Class Top2(object):
def __init__(self,ty): #Line 3
self.Y=ty #Line 4
def ChangeY(self,ty):
self.Y=self.Y+ty
def ShowY(self):
print self.Y,

class Bottom(Top1,Top2):
def __init__(self,tz): #Line 5
self.Z = tz #Line 6
Top2.__init__(self,2*tz) #Line 7
Top1.__init__(self,3*tz) #Line 8
def ChangeZ(self,tz):
self.Z=self.Z+tz
self.ChangeY(2*tz)
self.ChangeX(3*tz)
def ShowZ(self):
print self.Z,
self.ShowY()
self.ShowX()
B=Bottom(1)
B.ChangeZ(2)
B.ShowZ()
(i) Write the type of the inheritance illustrated in the above.

Ans Multiple Inheritance

Page #22/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

(1 Mark for writing correct Inheritance type)

(ii) Find and write the output of the above code.

Ans 3 6 9
OR
“Error” / “No Output”
(1 Mark for writing correct answer)

(iii) What are the methods shown in Line 1, Line 3 and Line 5 are known as?

Ans Constructors

(1 Mark for writing correct answer)

(iv) What is the difference between the statements shown in Line 6 and Line 7?

Ans Initializing the member of child class in Line 6 and calling the parent class
constructor in Line 7
(1 Mark for writing correct answer)

3 (a) Consider the following randomly ordered numbers stored in a list 3


786, 234, 526, 132, 345, 467,
Show the content of list after the First, Second and Third pass of the bubble sort
method used for arranging in ​ascending order​?
Note: Show the status of all the elements after each pass very clearly underlining
the changes.
Ans I Pass ​ 34, 526, 132, 345, 467, 786
2
II Pass ​234, ​132​, ​345​, 4​ 67​, ​526​, 786
III Pass ​ ​132​, 2​ 34​, 3
​ 45​, 467, 526, 786
(1 mark for each correct pass)

(b) Write definition of a method ​ZeroEnding(SCORES) to add all those values in the 3
list of SCORES, which are ending with zero (0) and display the sum.
For example,
If the SCORES contain [200,456,300,100,234,678]

The sum should be displayed as 600


Ans def ZeroEnding(SCORES):
s=0
for i in SCORES:
if i%10==0:
s=s+i
print s
( ½ mark for function header)
( ½ mark for initializing s (sum) with 0)

Page #23/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

( ½ mark for reading each element of the list using a loop)


( ½ mark for checking whether the value is ending with 0)
( ½ mark for adding it to the sum )
( ½ mark for printing or returning the value)
(c) Write AddClient(Client) and DeleteCleint(Client) methods in python to add a new 4
Client and delete a Client from a List of Client Names, considering them to act as
insert and delete operations of the queue data structure.
Ans def AddClient(Client):
C=raw_input("Client name: ")
Client.append(C)
def DeleteClient(Client):
if (Client==[]):
print "Queue empty"
else:
print Client[0],"Deleted"
del Client[0] # OR Client.pop(0)
OR
class queue:
Client=[]
def AddClient(self):
a=raw_input("Client name: ")
queue.Client.append(a)
def DeleteClient(self):
if (queue.Client==[]):
print "Queue empty"
else:
print queue.Client[0],"Deleted"
del queue.Client[0]
( ½ mark insert header)
( ½ mark for accepting a value from user)
( ½ mark for adding value in list)
( ½ mark for delete header)
( ½ mark for checking empty list condition)
( ½ mark for displaying “Queue empty”)
( ½ mark for displaying the value to be deleted)
( ½ mark for deleting value from list)
(d) Write definition of a Method COUNTNOW(PLACES) to find and display those place 2
names, in which there are more than 5 characters.
For example:
If the list PLACES contains
["DELHI","LONDON","PARIS","NEW YORK","DUBAI"]
The following should get displayed
LONDON
NEW YORK
Ans def COUNTNOW(PLACES):

Page #24/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

for P in PLACES:
if len(P)>5:
print P
(1 Mark for correct loop)
(½ Mark for checking length of place name)
(½ Mark for display desired place names)
(e) Evaluate the following Postfix notation of expression: 2

22,11,/,5,10,*,+,12,-

Ans
Element Stack Contents
22 22
11 22, 11
/ 2
5 2, 5
10 2, 5, 10
* 2, 50
+ 52
12 52, 12
- 40
OR
Any other way of stepwise evaluation
(½ Mark for evaluation till each operator)
OR
(1 Mark for only writing the correct answer without showing stack
status)

4 (a) Write a statement in Python to open a text file STORY.TXT so that new contents 1
can be added at the end of it.
Ans file= open("STORY.TXT","a") ​OR​ file.open("STORY.TXT","a")

(1 mark for correct statement)

(b) Write a method in python to read lines from a text file INDIA.TXT, to find and 2
display the occurrence of the word “India”.
For example:
If the content of the file is
_______________________________________________________________________
“India is the fastest growing economy.
India is looking for more investments around the globe.
The whole world is looking at India as a great market.
Most of the Indians can foresee the heights that India is
capable of reaching.”
_______________________________________________________________________
The output should be 4

Page #25/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

Ans def display1():


c=0
file=open('INDIA.TXT','r')
c=0
for LINE in file:
Words = LINE.split()
for W in Words:
if W=="India":
c=c+1
print c
file.close()
OR
def display():
c=0
file=open('INDIA.TXT','r')

lines = file.read() # lines = file.readline()


while lines:
words = lines.split()
for w in words:
if w=="India":
c=c+1
lines = file.read() # lines = file.readline()
print c
file.close()

(½ Mark for opening the file)


(½ Mark for reading all lines, and dividing it into words)
(½ Mark for checking condition and incrementing count)
(½ Mark for displaying count)

Note: Ignore if try: except:


(c) Considering the following definition of class MULTIPLEX, write a method in python 3
to search and display all the content in a pickled file CINEMA.DAT, where MTYPE is
matching with the value ‘Comedy’.
class MULTIPLEX:
def __init__(self,mno,mname,mtype):
self.MNO = mno
self.MNAME = mname
self.MTYPE = mtype
def Show(self):
print self.MNO:"*",self.MNAME,"$",self.MTYPE
Ans def Search():
file=open('CINEMA.DAT','rb')
try:
while True:
M=pickle.load(file)
if M.MTYPE=="Comedy":
M.Show()
except EOFError:
pass

Page #26/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

file.close()
(½ Mark for correct function header)
(½ Mark for opening the file CINEMA.DAT correctly)
(½ Mark for correct loop)
(½ Mark for correct load())
(½ Mark for correct checking of MTYPE)
(½ Mark for displaying the record)

SECTION C - (For all the candidates)


5 (a) Observe the following tables VIDEO and MEMBER carefully and write the name of 2
the RDBMS operation out of (i) SELECTION (ii) PROJECTION (iii) UNION (iv)
CARTESIAN PRODUCT, which has been used to produce the output as shown below,
Also, find the Degree and Cardinality of the final result.

TABLE: VIDEO
VNO VNAME TYPE
F101 The Last Battle Fiction
C101 Angels and Devils Comedy
A102 Daredevils Adventure

TABLE: MEMBER
MNO MNAME
M101 Namish Gupta
M102 Sana Sheikh
M103 Lara James

FINAL RESULT
VNO VNAME TYPE MNO MNAME
F101 The Last Battle Fiction M101 Namish Gupta
F101 The Last Battle Fiction M102 Sana Sheikh
F101 The Last Battle Fiction M103 Lara James
C101 Angels and Devils Comedy M101 Namish Gupta
C101 Angels and Devils Comedy M102 Sana Sheikh
C101 Angels and Devils Comedy M103 Lara James
A102 Daredevils Adventure M101 Namish Gupta
A102 Daredevils Adventure M102 Sana Sheikh
A102 Daredevils Adventure M103 Lara James

Ans CARTESIAN PRODUCT

Page #27/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

OR Option (iv)
DEGREE = 5
CARDINALITY = 9
(1 Mark for writing CARTESIAN PRODUCT OR Option (iv))
(½ Mark for writing correct Degree)
(½ Mark for writing correct Cardinality)
(b) Write SQL queries for (i) to (iv) and find outputs for SQL queries (v) to (viii), which 6
are based on the tables.

Table: ACCOUNT
ANO ANAME ADDRESS
101 Nirja Singh Bangalore
102 Rohan Gupta Chennai
103 Ali Reza Hyderabad
104 Rishabh Jain Chennai
105 Simran Kaur Chandigarh

Table: TRANSACT
TRNO ANO AMOUNT TYPE DOT
T001 101 2500 Withdraw 2017-12-21
T002 103 3000 Deposit 2017-06-01
T003 102 2000 Withdraw 2017-05-12
T004 103 1000 Deposit 2017-10-22
T005 101 12000 Deposit 2017-11-06

(i) To display details of all transactions of TYPE Deposit from Table TRANSACT.

Ans SELECT * FROM TRANSACT WHERE TYPE = ​'​Deposit​'​;

(½ Mark for correct SELECT statement)


(½ Mark for correct WHERE clause)
(ii) To display the ANO and AMOUNT of all Deposits and Withdrawals done in the
month of October 2017 from table TRANSACT.
Ans SELECT ANO,AMOUNT FROM TRANSACT
WHERE DOT >= ​'​2017-10-01​'​ AND DOT <= ​'​2017-10-31​'​;
OR
SELECT ANO,AMOUNT FROM TRANSACT
WHERE DOT BETWEEN ​'​2017-10-01​'​ AND ​'​2017-10-31​'​;
(½ Mark for correct SELECT statement)

Page #28/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

(½ Mark for correct WHERE clause)


Note:
● No marks to be deducted if MONTH() is used.
● No marks to be deducted if LIKE clause is used correctly.
(iii) To display the last date of transaction (DOT) from the table TRANSACT for the
Accounts having ANO as 103.
Ans SELECT MAX(DOT) FROM TRANSACT WHERE ANO = 103;
(½ Mark for correct SELECT statement)
(½ Mark for correct WHERE clause)
(iv) To display all ANO, ANAME and DOT of those persons from tables ACCOUNT and
TRANSACT who have done transactions less than or equal to 3000.
Ans SELECT ACCOUNT.ANO,ANAME,DOT FROM ACCOUNT,TRANSACT WHERE
ACCOUNT.ANO=TRANSACT.ANO AND AMOUNT <=3000;
OR
SELECT A.ANO,ANAME,DOT FROM ACCOUNT A,TRANSACT T WHERE
A.ANO=T.ANO AND AMOUNT <=3000;
(½ Mark for correct SELECT statement)
(½ Mark for correct WHERE clause)
NOTE:
● Marks not to be deducted for writing ​SELECT ANO ​instead of
SELECT ACCOUNT.ANO / SELECT A.ANO
(v) SELECT ANO, ANAME FROM ACCOUNT
WHERE ADDRESS NOT IN ('CHENNAI', 'BANGALORE');
Ans ANO​ ​ANAME
103 Ali Reza
105 Simran Kaur

OR
ANO​ ​ NAME
A
101 Nirja Singh
102 Rohan Gupta
103 Ali Reza
104 Rishabh Jain
105 Simran Kaur
(½ Mark for correct output)

(vi) SELECT DISTINCT ANO FROM TRANSACT;

Ans DISTINCT ANO


101
102
103

Page #29/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

(½ Mark for correct output)


NOTE: Values may be written in any order
(vii) SELECT ANO, COUNT(*), MIN(AMOUNT) FROM TRANSACT
GROUP BY ANO HAVING COUNT(*)> 1;
Ans ANO​ ​COUNT(*)​ ​MIN(AMOUNT)
101 2 2500
103 2 1000
(½ Mark for correct output)
NOTE: Values may be written in any order
(viii) SELECT COUNT(*), SUM(AMOUNT) FROM TRANSACT
WHERE DOT <= '2017-06-01';
Ans COUNT(*)​ ​ UM(AMOUNT)
S
2 5000
(½ Mark for correct output)

6 (a) State any one Absorption Law of Boolean Algebra and verify it using truth table. 2
Ans X + X . Y = X
Verification:
X Y X.Y X+X.Y
0 0 0 0
0 1 0 0
1 0 0 1
1 1 1 1
OR
X . (X + Y)= X
Verification:
X Y X+Y X.(X+Y)
0 0 0 0
0 1 1 0
1 0 1 1
1 1 1 1

OR
X + X’ . Y = X + Y
Verification:
X Y X’ X’.Y X+X’.Y X+Y
0 0 1 0 0 0
0 1 1 1 1 1
1 0 0 0 1 1
1 1 0 0 1 1
OR

Page #30/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

X . (X’+ Y)= X . Y
Verification:
X Y X’ X’+ Y X.(X’+Y) X.Y
0 0 1 1 0 0
0 1 1 1 0 0
1 0 0 0 0 0
1 1 0 1 1 1

(1 Mark for stating any one Absorption Law correctly)


(1 Mark for correctly verifying the stated Law using Truth Table)
(b) Draw the Logic Circuit of the following Boolean Expression: 2
​(U’+V).(V’+W’)
Ans

(Full 2 Marks for drawing the Logic Circuit for the expression correctly)
OR
(½ Mark for drawing Logic circuit for (U’ + V) correctly)
(½ Mark for drawing Logic circuit for (V’ + W’) correctly)
(c) Derive a Canonical POS expression for a Boolean function FN, represented by the 1
following truth table:
X Y Z FN(X,Y,Z)
0 0 0 1
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1

Ans FN(X,Y,Z)= (X+Y’+Z).(X+Y’+Z’).(X’+Y+Z’).(X’+Y’+Z)


OR
FN(X,Y,Z)= ​∏​(2,3,5,6)
(1 Mark for correctly writing the POS form)
OR
(½ Mark for any two correct terms)
Note: Deduct ½ mark if wrong variable names are written in the expression

Page #31/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

(d) Reduce the following Boolean Expression to its simplest form using K-Map: 3
G(U,V,W,Z) = ​∑​(3,5,6,7,11,12,13,15)

OR

F(U,V,W,Z)= VZ + WZ + UVW’+ U’VW


(½ Mark for drawing K-Map and correctly plotting 1s in the given cells)
( ½ Mark each for 4 groupings)
( ½ Mark for writing final expression in reduced/minimal form)
Note:
● Deduct ½ mark if wrong variable names are used
7 (a) Differentiate between Bus Topology and Star Topology of Networks. What are the 2
advantages and disadvantages of Star Topology over Bus Topology?
Ans
Bus Topology Star Topology
It is characterised by common It is characterised by central
transmission medium shared by all the switching node connected directly
connected nodes. to each of multiple nodes in the
network.

OR
Bus Topology Star Topology

Page #32/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

Advantages of Star Topology over Bus Topology


● Faster communication as compared to Bus topology
● Independent line of connection allows freedom of removing or adding nodes
from the network

Disadvantages of Star Topology over Bus Topology


● Expensive as compared to Bus topology
● Long cable length

(1 Mark for writing any correct difference between Bus and Star
Topology)
(½ Mark for writing any correct advantage of Star Topology over Bus)
(½ Mark for writing any correct disadvantage of Star Topology over
Bus)
(b) Classify each of the following Web Scripting as Client Side Scripting and Server 2
Side Scripting:
(i) JavaScripting (ii) ASP (iii) VB Scripting (iv) JSP

Ans (i) Client Side Scripting / Server Side Scripting (ii) Server Side Scripting
(iii) Client Side Scripting (iv) Server Side Scripting
(½ Mark for writing each correct classification)
(c) Write the expanded names for the following abbreviated terms used in Networking 2
and Communications:
(i) SMTP (ii) VoIP (iii) GSM (iv) WLL
Ans (i) ​Simple Mail Transfer Protocol
(ii) Voice over Internet Protocol (Voice over IP)
(iii) Global System for Mobile Communication
(iv) Wireless Local Loop
(½ Mark for writing each correct expansion)
(d) CASE STUDY BASED QUESTION:
Ayurveda Training Educational Institute is setting up its centre in Hyderabad with
four specialised departments for Orthopedics, Neurology and Pediatrics along with
an administrative office in separate buildings. The physical distances between
these department buildings and the number of computers to be installed in these
departments and administrative office as given as follows. You as a network

Page #33/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

expert have to answer the queries as raised by them in (i) to (iv).


Shortest distances between various locations in metres:
Administrative Office to Orthopedics Unit 55

Neurology Unit to Administrative Office 30

Orthopedics Unit to Neurology Unit 70

Pediatrics Unit to Neurology Unit 50

Pediatrics Unit to Administrative Office 40

Pediatrics Unit to Orthopedics Unit 110

Number of Computers installed at the various locations are as follows:


Pediatrics Unit 40

Administrative Office 140

Neurology 50

Orthopedics Unit 80

(i) Suggest the most suitable location to install the main server of this institution to 1
get efficient connectivity.

Ans Administrative Office


(1 Mark for writing correct location)
(ii) Suggest the best cable layout for effective network connectivity of the building 1
having server with all the other buildings.

Page #34/35
CBSE AISSCE 2017-2018 Marking Scheme for Computer Science
(2018-2019 Sub Code: 083 Paper Code: 91)

Ans

OR
Administrative Office is connected to Orthopedic, Radiology, Pediatrics units
directly in a Star Topology
(1 Mark for drawing/writing the layout correctly)
(iii) Suggest the devices to be installed in each of these buildings for connecting 1
computers installed within the building out of the following:
● Gateway
● Modem
● Switch
Ans Switch
(1 Mark for writing the correct device)
(iv) Suggest the topology of the network and network cable for efficiently connecting 1
each computer installed in each of the buildings out of the following:
Topologies : Bus topology, Star Topology
Network Cable: Single Pair Telephone Cable, Coaxial Cable, Ethernet Cable
Ans Topology : Star Topology
Network Cable: Ethernet Cable / Coaxial Cable
(½ Mark for writing the correct topology)
(½ Mark for writing the correct network cable)

Page #35/35
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)
General Instructions:
● The answers given in the marking scheme are SUGGESTIVE. Examiners are
requested to award marks for all alternative correct Solutions/Answers
conveying the similar meaning
● All programming questions have to be answered with respect to C++
Language / Python only
● In C++ / Python, ignore case sensitivity for identifiers (Variable / Functions
/ Structures / Class Names)
● In Python indentation is mandatory, however, number of spaces used for
indenting may vary
● In SQL related questions – both ways of text/character entries should be
acceptable for Example: “AMAR” and ‘amar’ both are acceptable.
● In SQL related questions – all date entries should be acceptable for Example:
‘YYYY-MM-DD’, ‘YY-MM-DD’, ‘DD-Mon-YY’, “DD/MM/YY”, ‘DD/MM/YY’,
“MM/DD/YY”, ‘MM/DD/YY’ and {MM/DD/YY} are correct.
● In SQL related questions – semicolon should be ignored for terminating the
SQL statements
● In SQL related questions, ignore case sensitivity.
SECTION A - (Only for candidates, who opted for C++)
1 (a) Write the type of C++ tokens (keywords and user defined identifiers) from the 2
following:
(i) For
(ii) delete
(iii) default
(iv) Value

Ans (i) For - user defined identifier


(ii) delete - keyword
(iii) default - keyword
(iv) Value - user defined identifier
(½ Mark for writing each correct keywords)
(½ Mark for writing each correct user defined identifiers)
(b) Anil typed the following C++ code and during compilation he found four errors as 1
follows:
(i) Function strlen should have a prototype
(ii) Undefined symbol cout
(iii) Undefined symbol endl
(iv) Function getchar should have a prototype
On asking his teacher told him to include necessary header files in the code.
Write the names of the header files, which Anil needs to include, for successful
compilation and execution of the following code:
void main()
{
char S[] = "Hello";
for(int i = 0; i<strlen(S); i++)
S[i] = S[i]+1;
cout<<S<<endl;
getchar();
}

Page #1 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

Ans iostream.h or iomanip.h or fstream.h


string.h
stdio.h

(½ Mark each for writing any two correct header files)


NOTE:
Ignore additional header file(s)

(c) Rewrite the following C++ code after removing any/all syntactical errors 2
with each correction underlined.
Note: Assume all required header files are already being included in the
program.
void main()
{
cout<<"Enter an integer";
cin>>N;
switch(N%2)
case 0 cout<<"Even"; Break;
case 1 cout<<"Odd" ; Break;
}

Ans void main()


{
​int N; ​ // Error 1
cout<<"Enter an integer";
cin>>N;
switch(N%2)
​{ ​ // Error 2 (i)
case 0​:​ // Error 3 (i)
cout<<"Even"; ​break;​ // Error 4 (i)
case 1​:​ // Error 3 (ii)
cout<<"Odd" ; ​break;​ // Error 4 (ii)
}​ ​// Error 2 (ii)
}

(½ Mark for correcting Error 1)


(½ Mark for correcting Error 2(i) and Error 2(ii))
(½ Mark for correcting Error 3(i) and Error 3(ii))
(½ Mark for correcting Error 4(i) and Error 4(ii))
OR
(1 Mark for identifying all the errors without corrections)

(d) Find and write the output of the following C++ program code: 2
Note: Assume all required header files are already included in the
program.
#define Big(A,B) (A>B)?A+1:B+2
void main()

Page #2 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

{
char W[] = "Exam";
int L=strlen(W);
for(int i =0; i<L-1; i++)
W[i] = Big(W[i],W[i+1]);
cout<<W<<endl;
}

Ans zyom

(½ Mark for writing each correct value)


Deduct ½ Mark for writing the values in different lines

(e) Find and write the output of the following C++ program code: 3
Note: Assume all required header files are already being included in the program​.

void main()
{
int A[]={10,12,15,17,20,30};
for(int i = 0; i<6; i++)
{
if(A[i]%2==0)
A[i] /= 2;
else if(A[i]%3==0)
A[i] /= 3;
if(A[i]%5==0)
A[i] /= 5;
}
for(i = 0; i<6; i++)
cout<<A[i]<<”#”;
}

Ans 1#6#1#17#2#3#

(½ Mark for writing each correct value)

Note: Deduct ½ Mark for not considering any/all # as separator and or


writing the values in different lines

(f) Look at the following C++ code and find the possible output(s) from the options 2
(i) to (iv) following it. Also, write the maximum values that can be assigned to
each of the variables R and C.
Note:
●​ ​Assume all the required header files are already being included in the code.
●​ ​The function random(n) generates an integer between 0 and n-1
void main()
{
randomize();

Page #3 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

int R=random(3),C=random(4);
int MAT[3][3] = {{10,20,30},{20,30,40},{30,40,50}};
for(int I=0; I<R; I++)
{
for(int J=0; J<C; J++)
cout<<MAT[I][J]<<" ";
cout<<endl;
}
}

(i) (ii)
10 20 30 10 20 30
20 30 40 20 30 40
30 40 50
(iii) (iv)
10 20 10 20
20 30 20 30
30 40

Ans (ii) and (iii)


Max Value of R:2
Max Value of C:3

(1 Mark for writing the correct options)


NOTE: No marks to be awarded for writing any other option or any other
combination

(½ Mark for writing correct Maximum value of R)


(½ Mark for writing correct Maximum value of C)

2. (a) Differentiate between private and public members of a class in context of Object 2
Oriented Programming. Also give a suitable example illustrating
accessibility/non-accessibility of each using a class and an object in C++.

Ans private public


Implicit Visibility Mode Explicit Visibility Mode

Not accessible by the objects of class Accessible by the objects of class


Example:
class A
{
int x; //private Member
public:
void In();//public member
};
void main()
{
A obja;
cin>>obja.x;//Not Accessible
obja.In();//accessible
}

Page #4 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)
OR
Any other correct example demonstrating difference between private and
public members of a class
(Full 2 Marks for any one correct difference between private and public
members of a class using a suitable code in C++)

OR
(1 Mark for writing correct difference between private and public members
in a class without example)

(b) Observe the following C++ code and answer the questions (i) and (ii).
Note: Assume all necessary files are included.
class EXAM
{
long Code;
char EName[20];
float Marks;
public:
EXAM() //Member Function 1
{
Code=100;strcpy(EName,"Noname");Marks=0;
}
EXAM(EXAM &E) //Member Function 2
{
Code=E.Code+1;
strcpy(EName,E.EName);
Marks=E.Marks;
}
};
void main()
{
___________________ //Statement 1
___________________ //Statement 2
}

(i) Which Object Oriented Programming feature is illustrated by the Member 1


Function 1 and Member Function 2 together in the class EXAM?

Ans Polymorphism OR Constructor overloading OR Function Overloading

(1Mark for mentioning the correct concept name )

(ii) Write Statement 1 and Statement 2 to execute Member Function 1 and 1


Member Function 2 respectively.

Ans EXAM E1; ​ //Statement 1

EXAM E2(E1);​ //Statement 2


OR
EXAM E2=E1; ​ //Statement 2

Page #5 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

( ½ Mark for writing statement 1 correctly)


( ½ Mark for writing statement 2 correctly)

(c) Write the definition of a class RING in C++ with following description: 4
Private Members
- RingNumber // data member of integer type
- Radius // data member of float type
- Area // data member of float type
- CalcArea() // Member function to calculate and assign
// Area as 3.14 * Radius*Radius
Public Members
- GetArea() // A function to allow user to enter values of
// RingNumber and Radius. Also, this
// function should call CalcArea() to calculate
// Area
- ShowArea() // A function to display RingNumber, Radius
// and Area

Ans class RING


{
int RingNumber ;
float Radius ;
float Area ;
void CalcArea(){Area=3.14*Radius*Radius;}
public:
void GetArea();
void ShowArea();
};
void RING::GetArea()
{
cin>>RingNumber>>Radius;
CalcArea();
}
void RING::ShowArea()
{
cout<<RingNumber<<” ”<<Radius<<” ”<<Area<<endl;
}

(½ Mark for declaring class header correctly)


(½ Mark for declaring data members correctly)
(1 Mark for defining CalcArea() correctly)
(½ Mark for taking inputs of RingNumber and Radius in GetArea())
(½ Mark for invoking CalcArea() inside GetArea())
(½ Mark for defining ShowArea() correctly)
(½ Mark for correctly closing class declaration with a semicolon ; )
NOTE:
Marks to be awarded for defining the member functions inside or outside the
class

(d) Answer the questions (i) to (iv) based on the following: 4


class One
{

Page #6 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

int A1;
protected:
float A2;
public:
One();
void Get1(); void Show1();
};
class Two : private One
{
int B1;
protected:
float B2;
public:
Two();
void Get2();
void Show();
};
class Three : public Two
{
int C1;
public:
Three();
void Get3();
void Show();
};
void main()
{
Three T; //Statement 1
__________________;//Statement 2
}
(i) Which type of Inheritance out of the following is illustrated in the above example?
-Single Level Inheritance, Multilevel Inheritance, Multiple Inheritance

Ans Multilevel Inheritance

(1 Mark for writing correct option)


(ii) Write the names of all the member functions, which are directly accessible by the
object T of class Three as declared in main() function.

Ans Get3(),Show() of class Three


Get2(),Show() of class Two
OR
Get3(),Show() ​OR​ Three::Show()
Get2(),Two::Show()
(1 Mark for writing all correct function names )

NOTE:
● Marks not to be awarded for partially correct answer
● Ignore the mention of Constructors
(iii) Write Statement 2 to call function Show() of class Two from the object T of class
Three.

Page #7 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

Ans T.Two::Show()

(1 Mark for writing Statement 2 correctly)


(iv) What will be the order of execution of the constructors, when the object T of
class Three is declared inside main()?

Ans One,Two, Three

(1 Mark for writing correct order)


NOTE:
● No Marks to be awarded for any other combination/order.
● Names of the constructor/class without parenthesis is acceptable

3 (a) Write the definition of a function Reverse(int Arr[], int N) in C++, which should 3
reverse the entire content of the array Arr having N elements, without using any
other array.
Example: if the array Arr contains
13 10 15 20 5
Then the array should become
5 20 15 10 13
NOTE:
● The function should only rearrange the content of the array.
● The function should not copy the reversed content in another array.
● The function should not display the content of the array.

Ans void Reverse(int Arr[],int N)


{
for (int I=0;I<N/2;I++)
{
int T=Arr[I];
Arr[I]=Arr[N-I-1];
Arr[N-I-1]=T;
}
}
OR
Any other correct alternative code in C++

(1 ½ Mark for correctly writing the loop)


(1 ½ Mark for correctly writing the logic for reversing the content)
(b) Write definition for a function ADDMIDROW(int MAT[][10],int R,int C) in C++, 2
which finds sum of the middle row elements of the matrix MAT (Assuming C
represents number of Columns and R represents number of rows, which is an odd
integer).
For example, if the content of array MAT having R as 3 and C as 5 is as follows:
1 2 3 4 5

2 1 3 4 5

3 4 1 2 5

Page #8 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)
The function should calculate the sum and display the following:
Sum of Middle Row: 15

​Ans void ADDMIDROW(int MAT[][10],int R,int C)


{
int MIDR=0;
for (int J=0;J<C;J++)
MIDR+=MAT[R/2][J];
cout<<”Sum of Middle Row:”<<MIDR<<endl;
}
OR
Any other correct alternative code in C++

(½ Mark for correctly writing the loop)


(1 Mark for adding middle row elements)
(½ Mark for displaying the sum of middle row elements)
(c) T[25][30] is a two dimensional array, which is stored in the memory along the row 3
with each of its element occupying 2 bytes, find the address of the element
T[10][15], if the element T[5][10] is stored at the memory location 25000.

Ans LOC(T[I][J]) = Base(T)+W*(NC*I+J)


LOC(T[5][10]) = Base(T)+2*(30*5+10)
25000 = Base(T)+2*(30*5+10)
Base(T) = 25000 - 2*(160)
Base(T) = 25000 - 320
Base(T) = 24680

LOC(T[10][15])= 24680 + 2*(30*10+15)


= 24680 + 2*(315)
= 24680 + 630
= 25310
OR
LOC(T[10][15]) = LOC(T[5][10]) + 2(30*(10-5) + (15-10))
= 25000 + 2(150 + 5)
= 25000 + 2(155)
= 25000 + 310
= 25310

(1 Mark for writing correct formula (for Row major) OR substituting


formula with correct values)
(1Mark for correct calculation)
(1 Mark for final correct address)
(d) Write the definition of a member function ADDMEM() for a class QUEUE in 4
C++, to add a MEMBER in a dynamically allocated Queue of Members
considering the following code is already written as a part of the program.

struct Member
{
int MNO;
char MNAME[20];
Member *Next;

Page #9 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

};
class QUEUE
{
Member *Rear,*Front;
public:
QUEUE(){Rear=NULL;Front=NULL;}
void ADDMEM();
void REMOVEMEM();
~QUEUE();
};

ANS void QUEUE::ADDMEM()


{
Member *T;
T=new Member;
cin>>T->MNO;
gets(T->MNAME);
T->Next=NULL;
if (Rear==NULL)
{
Rear=T;Front=T;
}
else
{
Rear->Next=T;
Rear=T;
}
}
OR
Any other equivalent code in C++

(1 Mark for creating a new Node)


(1 Mark for accepting values of MNO and MNAME)
(½ Mark for checking EMPTY condition)
(½ Mark for assigning NULL to Rear and Front as T)
(½ Mark for connecting Rear with T)
(½ Mark for assigning Rear as T)
(e) Convert the following Infix expression to its equivalent Postfix expression, showing 2
the stack contents for each step of conversion.
P + ( Q - R ) * S / T

Ans (P+(((Q-R)*S)/T))
INFIX STACK POSTFIX
P P
+ + P
Q + PQ
- +- PQ
R +- PQR

Page #10 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

) + PQR-
* +* PQR-
S +* PQR-S
) + PQR-S*
/ +/ PQR-S*
T +/ PQR-S*T
) + PQR-S*T/
) PQR-S*T/+

OR
INFIX STACK POSTFIX
( (
P ( P
+ (+ P
( (+( P
Q (+( PQ
- (+(- PQ
R (+(- PQR
) (+ PQR-
* (+* PQR-
S (+* PQR-S
/ (+/ PQR-S*
T (+/ PQR-S*T
) PQR-S*T/+

(½ Mark for conversion upto each operator illustrating through stack)


OR
(1 Mark for only the final answer as ​PQR-S*T/+​)

4. (a) Aditi has used a text editing software to type some text. After saving the article as 3
WORDS.TXT​, she realised that she has wrongly typed alphabet J in place of alphabet I
everywhere in the article.

Write a function definition for JTOI() in C++ that would display the corrected version of
entire content of the file ​WORDS.TXT with all the alphabets “J” to be displayed as an
alphabet “I” on screen​.
Note: Assuming that ​WORD.TXT​ does not contain any J alphabet otherwise.
Example:
If Aditi has stored the following content in the file ​WORDS.TXT​:

WELL, THJS JS A WORD BY JTSELF. YOU COULD STRETCH THJS TO BE


A SENTENCE
The function JTOI() should display the following content:

WELL, THIS IS A WORD BY ITSELF. YOU COULD STRETCH THIS TO BE

Page #11 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

A SENTENCE

Ans void JTOI()


{
char ch;
ifstream F("WORDS.TXT" );
while(F.get(ch))
{
if(ch==’J’)
ch=’I’;
cout<<ch;
}
F.close(); ​//IGNORE
}
OR
Any other correct function definition

(1 Mark for opening WORDS.TXT / WORD.TXT correctly)


(1 Mark for reading each character ​(using any method)​ from the file)
(1 Mark for displaying ‘I’ in place of ‘J’)
(b) Write a definition for function COUNTDEPT( ) in C++ to read each object of a 2
binary file TEACHERS.DAT, find and display the total number of teachers in the
department MATHS. Assume that the file TEACHERS.DAT is created with the help
of objects of class TEACHERS, which is defined below:
class TEACHERS
{
int TID; char DEPT[20];
public:
void GET()
{
cin>>TID;gets(DEPT);
}

void SHOW()
{
cout<<TID<<":"<<DEPT<<endl;
}
char *RDEPT(){return DEPT;}
};
Ans void COUNTDEPT()
{
ifstream F;
F.open("TEACHERS.DAT",
ios::binary);
int count=0;
Teachers obj;

Page #12 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

while(F.read((char*)&obj,
sizeof(obj)))
{
if(strcmp(obj.RDEPT(),“MATHS”)==0)
count++;
}
cout<<”Number of MATHS teachers :”<<count<<endl;
F.close(); ​//IGNORE
}
OR
Any other correct function definition
(½ Mark for opening TEACHERS.DAT correctly)
(½ Mark for reading records from TEACHERS.DAT)
(½ Mark for comparing DEPT of type MATHS(ignore case sensitive checking)
with strcmp or strcmpi)
(½ Mark for displaying the incremented count for matching records)
(c) Find the output of the following C++ code considering that the binary file 1
BOOK.DAT exists on the hard disk with a data of 200 books.
class BOOK
{
int BID;char BName[20];
public:
void Enter();void Display();
};
void main()
{
fstream InFile;
InFile.open("BOOK.DAT",ios::binary|ios::in);
BOOK B;
InFile.seekg(5*sizeof(B));
InFile.read((char*)&B, sizeof(B));
cout<<"Book Number:"<<InFile.tellg()/sizeof(B) + 1;
InFile.seekg(0,ios::end);
cout<<" of "<<InFile.tellg()/sizeof(B)<<endl;
InFile.close();
}

Ans ​Book Number: 7 of 200

(½ Mark for displaying correct value of InFile.tellg()/sizeof(B) + 1)


(½ Mark for displaying correct value of InFile.tellg()/sizeof(B))

SECTION B - (Only for candidates, who opted for Python)


1 (a) Which of the following can be used as valid variable identifier(s) in Python 2
(i)​ ​total
(ii)​ 7​ Salute
(iii)​ Q​ ue$tion
(iv)​ ​global
Ans (i)​ total

Page #13 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)
(2 marks for correct option)
NOTE:
Deduct ½ mark each for wrong options
(b) Name the Python Library modules which need to be imported to invoke the 1
following functions
(i) ​ceil() (ii) ​randint()
Ans (i) ​math ​(ii) ​random

(½ Mark for writing each correct Library modules)


NOTE:
Ignore any other Library modules, if mentioned
(c) Rewrite the following code in python after removing all syntax error(s). Underline 2
each correction done in the code
TEXT=""GREAT
DAY""
for T in range[0,7]:
print TEXT(T)
print T+TEXT
Ans TEXT=​"GREAT"
DAY =""
for T in range​(0,7)​:
print TEXT​[T]
print ​T,TEXT
Also range(0,7) will give a runtime error as the index is out of range. It should
be range(0,5)

(½ Mark for each correction, not exceeding 2 Marks)


OR
(1 mark for identifying the errors, without suggesting corrections)
(d) Find and write the output of the following Python code: 2
STR = ["90","10","30","40"]
COUNT = 3
SUM = 0
for I in [1,2,5,4]:
S = STR[COUNT]
SUM = float (S)+I
print SUM
COUNT-=1
Ans 41.0
32.0
15.0
94.0
( ½ mark for each correct line of output)
NOTE: Deduct ½ Mark for writing the answer in same line. Deduct ½ Mark for
writing numbers without decimal point
(e) Find and write the output of the following python code: 3
class ITEM:
def __init__(self,I=101,N="Pen",Q=10): #constructor

Page #14 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)
self.Ino=I
self.IName=N
self.Qty=int(Q);
def Buy(self,Q):
self.Qty = self.Qty + Q
def Sell(self,Q):
self.Qty -= Q
def ShowStock(self):
print self.Ino,":",self.IName,"#",self.Qty
I1=ITEM()
I2=ITEM(100,"Eraser",100)
I3=ITEM(102,"Sharpener")
I1.Buy(10)
I2.Sell(25)
I3.Buy(75)
I3.ShowStock()
I1.ShowStock()
I2.ShowStock()
Ans 102 : Sharpener # 85
101 : Pen # 20
100 : Eraser # 75
(1 mark for each correct line of output)
NOTE:
● Deduct ½ Mark for not writing any or all ‘:’ or ‘#’ symbol(s)
● Deduct ½ Mark for not considering any or all line breaks at proper place(s)
(f) What are the possible outcome(s) executed from the following code? Also specify 2
the maximum and minimum values that can be assigned to variable N.
import random
SIDES=["EAST","WEST","NORTH","SOUTH"];
N=random.randint(1,3)
OUT=""
for I in range(N,1,-1):
OUT=OUT+SIDES[I]
print OUT
(i) ​SOUTHNORTH (ii) ​SOUTHNORTHWEST

(iii) ​SOUTH (iv) ​EASTWESTNORTH

Ans (i) SOUTHNORTH


Maximum value of N = 3
Minimum value of N = 1

(1 mark for correct option)


NOTE: No marks to be awarded for writing any other option or any other
combination

( ½ each for maximum and minimum value of N)

Page #15 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

2 (a) List four characteristics of Object Oriented programming. 2


Ans Encapsulation
Data Hiding
Abstraction
Inheritance
Polymorphism

( ½ mark for each characteristic upto four characteristics)


(b) class Test: 2
rollno=1
marks=75
def __init__(self,r,m): #function 1
self.rollno=r
self.marks=m
def assign(self,r,m): #function 2
rollno = n
marks = m
def check(self): #function 3
print self.rollno,self.marks
print rollno,marks
(i) In the above class definition, both the functions - function 1 as well as function
2 have similar definition. How are they different in execution?
(ii) Write statements to execute function 1 and function 2.
Ans i) Function 1 is the constructor which gets executed automatically as soon as
the object of the class is created. Function 2 is a member function which has
to be called to assign the values to rollno and marks.

ii) Function 1 ​E1=Test(1,95) # Any values in the parameter


Function 2 ​E1.assign(1,95) # Any values in the parameter
(1 mark for correct difference)
( ½ mark for each statement for executing Function 1 and function 2)

(c) Define a class RING in Python with following specifications 4


Instance Attributes
- RingID # Numeric value with a default value 101
- Radius # Numeric value with a default value 10
- Area # Numeric value
Methods:
- AreaCal() # Method to calculate Area as
# 3.14*Radius*Radius
- NewRing() # Method to allow user to enter values of
# RingID and Radius. It should also
# Call AreaCal Method
- ViewRing() # Method to display all the Attributes
Page #16 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

Ans class RING:​ ​# OR class RING( ): ​OR class RING(Object):


def __init__(self):
self.RingID=101
self.Radius=10
self.Area=0
def AreaCal(self):
self.Area=3.14*self.Radius*self.Radius

def NewRing(self):
self.RingID=input("Enter RingID")
self.Radius=input("Enter radius")
self.AreaCal() # OR AreaCal(self)
def ViewRing(self):
print self.RingID
print self.Radius
print self.Area

(½ Mark for correct syntax for class header)


(½ Mark for correct declaration of instance attributes)
(1 Mark for correct definition of AreaCal() function)
(1 Mark for correct definition of NewRing() with invocation of AreaCal( ))
(1 Mark for correct definition of ViewRing())
NOTE:
Deduct ½ Mark if AreaCal() is not invoked properly inside NewRing() function
(d) Differentiate between static and dynamic binding in Python? Give suitable 2
examples of each.
Ans Static Binding: It allows linking of function call to the function definition during
compilation of the program.
Dynamic Binding: It allows linking of a function during run time. That means the
code of the function that is to be linked with function call is unknown until it is
executed. Dynamic binding of functions makes the programs more flexible.
(1 mark for each correct explanation of static and dynamic binding)
OR
(1 for each correct example of static and dynamic binding)
(e) Write two methods in Python using concept of Function Overloading 2
(Polymorphism) to perform the following operations:
(i) A function having one argument as side, to calculate Area of Square as
side*side
(ii) A function having two arguments as Length and Breadth, to calculate Area of
Rectangle as Length*Breadth.
Ans def Area(side):
print side*side
def Area(length,breadth):
print length*breadth

Page #17 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)
NOTE: ​Python does not support function overloading “​as illustrated in
the example shown above​”. If you run the code, the second Area(B,H)
definition will overwrite/override the first one.
(1 mark for each function definition)
OR
(Full 2 Marks for mentioning Python does not support function
overloading)
3. (a) What will be the status of the following list after the First, Second and Third pass 3
of the bubble sort method used for arranging the following elements in
descending order​?
Note: Show the status of all the elements after each pass very clearly underlining
the changes.
152, 104, -100, 604, 190, 204
Ans I Pass
152 104 -100 604 190 204
152 104 -100 604 190 204
152 104 -100 604 190 204
152 104 604 -100 190 204
152 104 604 190 -100 204
152 104 604 190 204 -100
II Pass
152 104 604 190 204 -100
152 104 604 190 204 -100
152 604 104 190 204 -100
152 604 190 104 204 -100
152 604 190 204 104 -100
III Pass
152 604 190 204 104 -100
604 152 190 204 104 -100
604 190 152 204 104 -100
604 190 204 152 104 -100
(1 mark for last set of values of each correct pass)
(b) Write definition of a method ​OddSum(NUMBERS) to add those values in the list of 3
NUMBERS, which are odd.
Ans def OddSum(NUMBERS):
n=len(NUMBERS)
s=0
for i in range(n):
if (i%2!=0):
s=s+NUMBERS[i]
print(s)
(½ mark for finding length of the list)
( ½ mark for initializing s (sum) with 0)
( ½ mark for reading each element of the list using a loop)
( ½ mark for checking odd location)
( ½ mark for adding it to the sum)
( ½ mark for printing or returning the value)

Page #18 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)
(c) Write Addnew(Book) and Remove(Book) methods in Python to Add a new Book and 4
Remove a Book from a List of Books, considering them to act as PUSH and POP
operations of the data structure Stack.

Ans class stack:


Book=[]
def Addnew(self):
Name=input("Enter Book Name :")
stack.Book.append(Name)
def Remove(self):
if (stack.Book==[]):
print "Stack Empty"
else:
print "Deleted Book is : ",stack.Book.pop()
( ½ mark for Addnew header)
( ½ mark for accepting a Book from user)
( 1 mark for adding value in list)
( ½ mark for Remove header)
( ½ mark for checking empty list condition)
( ½ mark for displaying Book getting removed)
( ½ mark for removing Book)
NOTE:
Marks not to be deducted for methods written without using a class
(d) Write definition of a Method AFIND(CITIES) to display all the city names from a list 2
of CITIES, which are starting with alphabet A.
For example:
If the list CITIES contains
["AHMEDABAD","CHENNAI","NEW DELHI","AMRITSAR","AGRA"]

The following should get displayed


AHEMDABAD
AMRITSAR
AGRA
Ans def AFIND(CITIES):
for i in CITIES:
if i[0]=='A':
print i
( ½ mark function header)
( ½ mark for loop)
( ½ mark for checking condition of first letter A)
( ½ mark for displaying value)
(e) Evaluate the following Postfix notation of expression: 2
2,3,*,24,2,6,+,/,-
Ans
Element Stack Contents
2 2
3 2, 3
* 6
24 6, 24
2 6, 24, 2

Page #19 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

6 6, 24, 2, 6
+ 6, 24, 8
/ 6, 3
3
Answer: 3
(½ Mark for evaluation till each operator)
OR
(1 Mark for only writing the Final answer without showing stack
status)
4 (a) Differentiate between file modes ​r+​ and w
​ +​ with respect to Python. 1
Ans ● r+ Opens a file for both reading and writing. The file pointer
placed at the beginning of the file.
● w+ Opens a file for both writing and reading. Overwrites the
existing file if the file exists. If the file does not exist, creates a
new file for reading and writing.
(1 mark for one of the correct difference )
OR
(½ Mark for each correct use of r+ and w+)
(b) Write a method in Python to read lines from a text file DIARY.TXT, and display 2
those lines, which are starting with an alphabet ‘P’.
Ans def display():
file=open('DIARY.TXT','r')
line=file.readline()
while line:
if line[0]=='P' :
print line
line=file.readline()
file.close() #IGNORE
(½ Mark for opening the file)
(½ Mark for reading all lines)
(½ Mark for checking condition for line starting with P)
(½ Mark for displaying line)
(c) Considering the following definition of class COMPANY, write a method in Python 3
to search and display the content in a pickled file COMPANY.DAT, where CompID is
matching with the value ‘1005’.

class Company:
def __init__(self,CID,NAM):
self.CompID = CID #CompID Company ID
self.CName = NAM #CName Company Name
self.Turnover = 1000
def Display(self):
print self.CompID,":",self.CName,":",self.Turnover
Ans import pickle
def ques4c( ):
f=Factory( )
file=open('COMPANY.DAT','rb')
try:
Page #20 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)
while True:
f=pickle.load(file)
if f.CompID==1005:
f.Display()
except EOF Error:
pass
file.close() #IGNORE
(½ Mark for correct function header)
(½ Mark for opening the file COMPANY.DAT correctly)
(½ Mark for correct loop)
(½ Mark for correct load( ))
(½ Mark for correct checking of CompID)
(½ Mark for displaying the record)
SECTION C - (For all the candidates)
5 (a) Observe the following table CANDIDATE carefully and write the name of the 2
RDBMS operation out of (i) SELECTION (ii) PROJECTION (iii) UNION (iv) CARTESIAN
PRODUCT, which has been used to produce the output as shown in RESULT ? Also,
find the Degree and Cardinality of the RESULT.
TABLE: CANDIDATE
NO NAME STREAM
C1 AJAY LAW
C2 ADITI MEDICAL
C3 ROHAN EDUCATION
C4 RISHAB ENGINEERING

RESULT
NO NAME
C3 ROHAN

Ans (i) SELECTION and (ii) PROJECTION


OR
(i) SELECTION
OR
(ii) PROJECTION
DEGREE = 2
CARDINALITY = 1

(1 Mark for writing the correct RDBMS operation as any one of the
given options)
(½ Mark for writing correct degree)
(½ Mark for writing correct cardinality)
(b) Write SQL queries for (i) to (iv) and find outputs for SQL queries (v) to (viii), which 6
are based on the tables
TABLE : BOOK
Code BNAME TYPE
F101 The priest Fiction
L102 German easy Literature

Page #21 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

C101 Tarzan in the lost world Comic


F102 Untold Story Fiction
C102 War Heroes Comic
TABLE: MEMBER
MNO MNANE CODE ISSUEDATE
M101 RAGHAV SINHA L102 2016-10-13
M103 SARTHAK JOHN F102 2017-02-23
M102 ANISHA KHAN C101 2016-06-12

(i) To display all details from table MEMBER in descending order of ISSUEDATE.

Ans SELECT * FROM MEMBER ORDER BY ISSUEDATE DESC;

(½ Mark for correct SELECT statement)


(½ Mark for correct ORDER BY clause)
(ii) To display the BNO and BNAME of all Fiction Type books from the table BOOK

Ans SELECT Code,BNAME FROM BOOK WHERE TYPE=’Fiction’;


OR
SELECT BNO,BNAME FROM BOOK WHERE TYPE=’Fiction’;

(½ Mark for correct SELECT statement)


(½ Mark for correct WHERE clause)
NOTE:
Full 1 Mark for mentioning BNO does not exist in table BOOK
(iii) To display the TYPE and number of books in each TYPE from the table BOOK

Ans SELECT COUNT(*),TYPE FROM BOOK GROUP BY TYPE;

(½ Mark for correct SELECT statement)


(½ Mark for correct GROUP BY clause)
(iv) To display all MNAME and ISSUEDATE of those members from table MEMBER who
have books issued (i.e ISSUEDATE) in the year 2017.

Ans SELECT MNAME, ISSUEDATE FROM MEMBER WHERE


ISSUEDATE>=’2017-01-01’ AND ISSUEDATE<=’2017-12-31’;
OR
SELECT MNAME, ISSUEDATE FROM MEMBER WHERE ISSUEDATE
BETWEEN ‘2017-01-01’ AND ‘2017-12-31’;
OR
SELECT MNAME, ISSUEDATE FROM MEMBER WHERE ISSUEDATE
LIKE ‘2017%’;

(½ Mark for correct SELECT statement)


(½ Mark for correct WHERE clause)
(v) SELECT MAX(ISSUEDATE) FROM MEMBER;

Ans MAX(ISSUEDATE)
2017-02-23

Page #22 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)
(½ Mark for correct output)

(vi) SELECT DISTINCT TYPE FROM BOOK;

Ans DISTINCT TYPE


Fiction
Literature
Comic
(½ Mark for correct output)
NOTE: Values may be written in any order
(vii) SELECT A.CODE,BNAME,MNO,MNAME FROM BOOK A, MEMBER B
WHERE A.CODE=B.CODE ;

Ans CODE​ ​BNAME​ ​MNO​ ​MNAME


L102 The priest M101 RAGHAV SINHA
F102 Untold Story M103 SARTHAK JOHN
C101 Tarzan in the lost world M102 ANISHA KHAN
(½ Mark for correct output)
(viii) SELECT BNAME FROM BOOK
WHERE TYPE NOT IN ("FICTION", "COMIC");

Ans BNAME
German Easy
OR
BNAME
The priest
German easy
Tarzan in the lost world
Untold Story
War heroes
(½ Mark for writing any one of the above two outputs)

6 (a) State Distributive Laws of Boolean Algebra and verify them using truth table. 2

Ans (i) X. (Y+Z)= X.Y + X.Z


(ii) X + Y.Z= (X + Y). (X+Z)
Truth Table Verification:
(i)
X Y Z Y+Z X.(Y+Z) X.Y X.Z X.Y + X.Z
0 0 0 0 0 0 0 0
0 0 1 1 0 0 0 0
0 1 0 1 0 0 0 0
0 1 1 1 0 0 0 0
1 0 0 0 0 0 0 0
1 0 1 1 1 0 1 1
1 1 0 1 1 1 0 1
1 1 1 1 1 1 1 1

Page #23 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

(ii)
X Y Z Y.Z X+Y.Z (X+Y) (X+Z) (X+Y).(X+Z)
0 0 0 0 0 0 0 0
0 0 1 0 0 0 1 0
0 1 0 0 0 1 0 0
0 1 1 1 1 1 1 1
1 0 0 0 1 1 1 1
1 0 1 0 1 1 1 1
1 1 0 0 1 1 1 1
1 1 1 1 1 1 1 1

(1 Mark for stating any one Distributive Law correctly)


(1 Mark for correctly verifying any one Distributive Law using Truth Table)
(b) Draw the Logic Circuit of the following Boolean Expression using only NAND Gates: 2
X.Y + Y.Z

Ans

(Full 2 Marks for drawing the Logic Circuit for the expression correctly)
OR
(½ Mark for drawing Logic circuit for (X NAND Y) correctly)
(½ Mark for drawing Logic circuit for (Y NAND Z) correctly)
(c) Derive a Canonical SOP expression for a Boolean function F, represented by 1
the following truth table:
U V W F(U,V,W)
0 0 0 1
0 0 1 0
0 1 0 1
0 1 1 1
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 0

Ans F(U,V,W)= U’V’W’ + U’VW’ + U’VW + UVW’

Page #24 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

OR
F(U,V,W)=∑(0,2,3,6)

(1 Mark for correctly writing the SOP form)


OR
(½ Mark for any two correct terms)
Note: Deduct ½ mark if wrong variable names are written in the expression
(d) Reduce the following Boolean Expression to its simplest form using K-Map: 3
F(X,Y,Z,W)= Σ (0,1,2,3,4,5,10,11,14)

Ans

OR

F(X,Y,Z,W)= X’Z’ + Y’Z + XZW’


(½ Mark for drawing K-Map with correct variable names)
(½ Mark for correctly plotting 1s in the given cells)
( ½ Mark each for 3 groupings)
( ½ Mark for writing final expression in reduced/minimal form)
Note:
● Deduct ½ mark if wrong variable names are used
● Deduct ½ mark for any redundant group appearing in final
expression
7 (a) Differentiate between Radio Link and Microwave in context of wireless 2
communication technologies.

Ans Radio Link: Data is transmitted outward from the antenna through free space in
all directions. It is a Slow means of communication;

Page #25 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

Microwave: Data is transmitted based on ​line of sight principle, faster than


radio communication.

(Full 2 marks for any correct difference between Radio Link and Microwave)
OR
(1 Mark for writing correct features of any one wireless medium out of Radio
Link or Microwave)
(b) Amit used a pen drive to copy files from his friend’s laptop to his office computer. 2
Soon his office computer started abnormal functioning. Sometimes it would restart
by itself and sometimes it would stop functioning totally. Which of the following
options out of (i) to (iv), would have caused the malfunctioning of the computer.
Justify the reason for your chosen option:
(i) Computer Worm
(ii) Computer Virus
(iii) Computer Bacteria
(iv) Trojan Horse

Ans (ii) Computer Virus


OR
(iv) Trojan Horse
● Pen drive containing Computer Virus / Trojan Horse was used
before the abnormal functioning started, which might have
corrupted the system files.
● Computer Virus/ Trojan Horse affects the system files and start
abnormal functioning in the computer

(1 Mark for writing any of the options (ii) OR (iv))


(1 Mark for writing any one correct justification)
(c) Jai is an IT expert and a freelancer. He recently used his skills to access the 2
Administrator password for the network server of Megatech Corpn Ltd. and
provided confidential data of the organization to its Director, informing him about
the vulnerability of their network security. Out of the following options (i) to (iv),
which one most appropriately defines Jai.
Justify the reason for your chosen option:
(i) Hacker
(ii) Cracker
(iii) Operator
(iv) Network Admin

Ans (i) Hacker


A Hacker is a person who breaks into the network of an organization
without any malicious intent.

(1 Mark for writing correct option)


(1 Mark for writing correct justification)
(d) Hi Speed Technologies Ltd is a Delhi based organization which is expanding its
office setup to Chandigarh. At Chandigarh office campus, they are planning to
have 3 different blocks for HR, Accounts and Logistics related work. Each block
has number of computers, which are required to be connected in a network for

Page #26 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)
communication, data and resource sharing.
As a network consultant, you have to suggest the best network related solutions
for them for issues/problems raised in (i) to (iv), keeping in mind the distances
between various blocks/locations and other given parameters.

Shortest distances between various blocks/locations:


HR Block to Accounts Block 400 Metres

Accounts Block to Logistics Block 200 Metres

Logistics Block to HR Block 150Metres

DELHI Head Office to CHANDIGARH Office 270 Km


Number of Computers installed at various blocks are as follows:
HR Block 70

Account Block 50

Logistics Block 40

(i) Suggest the most appropriate block/location to house the SERVER in the 1
CHANDIGARH Office (out of the 3 Blocks) to get the best and effective
connectivity. Justify your answer.

Ans HR Block - Because it has maximum number of computers.

(½ Mark for correct Block/location)


(½ Mark for valid justification)
(ii) Suggest the best wired medium and draw the cable layout (Block to Block) to 1
efficiently connect various Blocks within the CHANDIGARH office compound.
Ans Best wired medium: Optical Fibre OR CAT5 OR CAT6 OR CAT7 OR CAT8
OR Ethernet Cable

Page #27 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

OR

(½ Mark for writing best wired medium)


(½ Mark for drawing the layout correctly)
(iii) Suggest a device/software and its placement that would provide data security for 1
the entire network of CHANDIGARH office.
Ans Firewall - Placed with the server at the HR Block
OR
Any other valid device/software name
(½ Mark for writing device/software name correctly)
(½ Mark for writing correct placement)
(iv) Which of the following kind of network, would it be 1
(a) PAN
(b) WAN
(c) MAN
(d) LAN
Ans (b) WAN and (d) LAN
OR
(b) WAN
OR
(d) LAN
(1 Mark for writing any one of the correct option(s))

Page #28 of 28
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

General Instructions:
● The answers given in the marking scheme are SUGGESTIVE, Examiners are
requested to award marks for all alternative correct Solutions/Answers
conveying the similar meaning
● All programming questions have to be answered with respect to C++ Language /
Python only
● In C++ / Python, ignore case sensitivity for identifiers (Variable / Functions /
Structures / Class Names)
● In Python indentation is mandatory, however, number of spaces used for
indenting may vary
● In SQL related questions – both ways of text/character entries should be
acceptable for Example: “AMAR” and ‘amar’ both are acceptable.
● In SQL related questions – all date entries should be acceptable for Example:
‘YYYY‐MM‐DD’, ‘YY‐MM‐DD’, ‘DD‐Mon‐YY’, “DD/MM/YY”, ‘DD/MM/YY’,
“MM/DD/YY”, ‘MM/DD/YY’ and {MM/DD/YY} are correct.
● In SQL related questions – semicolon should be ignored for terminating the SQL
statements
● In SQL related questions, ignore case sensitivity.

SECTION A ‐ (Only for candidates, who opted for C++)


1 (a) Out of the following, find those identifiers, which cannot be used for naming 2
Variable, Constants or Functions in a C++ program:

_Cost, Price*Qty, float, Switch,


Address One, Delete, Number12, do

Ans Price*Qty
float
Address One
do

(½ Mark for each correct name)


Note:
Deduct ½ Mark for each wrong name written

(b) Jayapriya has started learning C++ and has typed the following program. When 1
she compiled the following code written by her, she discovered that she needs to
include some header files to successfully compile and execute it. Write the
names of those header files, which are required to be included in the code.

Page 1 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

void main()
{
float A,Number,Outcome;
cin>>A>>Number;
Outcome=pow(A,Number);
cout<<Outcome<<endl;
}

Ans ● iostream.h OR iomanip.h


● math.h

(½ Mark for writing each correct header file)


Note:
● Ignore any other header files, if mentioned.
● ​
is acceptable in place of math.h
complex.h​

(c) Rewrite the following C++ code after removing any/all syntactical errors with 2
each correction underlined.
Note: Assume all required header files are already being included in the program.

#define Equation(p,q) = p+2*q


void main()
{
float A=3.2;B=4.1;
C=Equation(A,B);
cout<<’Output=’<<C<<endl;
}

Ans #define Equation(p,q) p+2*q


void main()
{
float A=3.2​, ​
B=4.1;
float​C=Equation(A,B);

cout<<​
”Output=”​
<<C<<endl;
}
(½ Mark for each correction)
OR
(1 mark for identifying the errors, without suggesting corrections)

Page 2 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

(d) Find and write the output of the following C++ program code: 2
Note: Assume all required header files are already included in the
program.
typedef char STRING[80];
void MIXITNOW(STRING S)
{
int Size=strlen(S);
for (int I=0;I<Size­1;I+=2)
{
char WS=S[I];
S[I]=S[I+1];
S[I+1]=WS;
}
for (I=1;I<Size;I+=2)
if (S[I]>=’M’ && S[I]<=’U’)
S[I]=’@’;
}
void main()
{
STRING Word=”CRACKAJACK”;
MIXITNOW(Word);
cout<<Word<<endl;
}

Ans RCCAAKAJKC

(2 Marks for correct output)


OR
(½ Mark for each of two correct consecutive alphabets not exceeding
1½ marks )

(e) Find and write the output of the following C++ program code: 3
Note: Assume all required header files are already being included in the program.

class Stock
{
long int ID;

Page 3 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

float Rate; int Date;


public:
Stock(){ID=1001;Rate=200;Date=1;}
void RegCode(long int I,float R)
{
ID=I; Rate=R;
}
void Change(int New,int DT)
{
Rate+=New; Date=DT;
}
void Show()
{
cout<<”Date :”<<Date<<endl;
cout<<ID<<”#”<<Rate<<endl;
}

void main()
{
Stock A,B,C;
A.RegCode(1024,150);
B.RegCode(2015,300);
B.Change(100,29);
C.Change(­20,20);
A.Show();
B.Show();
C.Show();
}

Ans Date :1
1024#150
Date :29
2015#400
Date :20
1001#180
(½ Mark for each correct line of output)

Note:
● Deduct only ​
½ Mark for not writing any or all ‘Date’ OR ‘:’ OR ‘#’
symbol(s)
● Deduct ​
½ Mark for not considering any or all endl(s) at proper

Page 4 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

place(s)

(f) Look at the following C++ code and find the possible output(s) from the options 2
(i) to (iv) following it. Also, write the maximum and the minimum values that can
be assigned to the variable CHANGER.
Note:
● Assume all the required header files are already being included in the code.
● The function random(n) generates an integer between 0 and n‐1

void main()
{
randomize();
int CHANGER;
CHANGER=random(3);
char CITY[][25]={”DELHI”,”MUMBAI”,”KOLKATA” ,”CHENNAI”};
for(int I=0;I<=CHANGER;I++)
{
for(int J=0;J<=I;J++)
cout<<CITY[J];
cout<<endl;
}
}

(i) (ii)
DELHI DELHI
DELHIMUMABAI DELHIMUMABAI
DELHIMUMABAIKOLKATA DELHIMUMABAIKOLKATA
DELHIMUMABAIKOLKATACHENNAI
(iii) (iv)
MUMABAI KOLKATA
MUMABAIKOLKATA KOLKATACHENNAI
MUMABAIKOLKATACHENNAI

Ans (i)
DELHI
DELHIMUMBAI
DELHIMUMBAIKOLKATA

Page 5 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

Minimum Value of CHANGER = 0


Maximum Value of CHANGER = 2

(1 Mark for mentioning correct option)


Note: No Mark to be awarded for writing any one additional option
with (i) .

(½ Mark each for Minimum and Maximum Value of CHANGER)

2. (a) Differentiate between Constructor and Destructor functions giving suitable 2


example using a class in C++. When does each of them execute?

Ans PART 1:
Constructor Destructor
A constructor function has same name A destructor function has same name
as the class as the class preceded by ~ symbol

Example:
class Exam
{
int Eno; float Marks;
public:
Exam() //Constructor
{
Eno=1; Marks = 100;
cout<<”Constructor executed...”<<endl;
}
void Show()
{
cout<<Eno<<”#”<<Marks<<endl;
}
~Exam() //Destructor
{
cout<<”Exam Over”<<endl;
}

void main()
{
Exam E; //Executes constructor
E.Show();

Page 6 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

} //Executes Destructor

OR
Any other suitable example demonstrating difference between
Constructor and Destructor functions.

PART 2:
Execution of Constructor and Destructor:
Constructor Destructor
A constructor executes by itself at A destructor executes by itself
the time of object creation when the scope of an object
ends

PART 1:
(​
1 Mark for correct example of constructor and destructor function)
OR
(​
½ Mark each for correct definition of constructor and destructor
function)

PART 2:
(1 Mark for constructor and Destructor execution with/without
example )

(b) Observe the following C++ code and answer the questions (i) and (ii). Assume all
necessary files are included:
class FICTION
{
long FCode;
char FTitle[20];
float FPrice;
public:
FICTION() //Member Function 1
{
cout<<”Bought”<<endl;
FCode=100;strcpy(FTitle,”Noname”);FPrice=50;
}

FICTION(int C,char T[],float P) //Member Function 2


{
FCode=C;
strcpy(FTitle,T);

Page 7 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

FPrice=P;
}
void Increase(float P) //Member Function 3
{
FPrice+=P;
}
void Show() //Member Function 4
{
cout<<FCode<<”:”<<FTitle<<”:”<<FPrice<<endl;
}
~FICTION() //Member Function 5
{
cout<<”Fiction removed!”<<end1;
}

void main() //Line 1
{ //Line 2
FICTION F1,F2(101,”Dare”,75); //Line 3
for (int I=0;I<4;I++) //Line 4
{ //Line 5
F1.Increase(20);F2.Increase(15); //Line 6
F1.Show();F2.Show(); //Line 7
} //Line 8
} //Line 9

(i) Which specific concept of object oriented programming out of the following is 1
illustrated by Member Function 1 and Member Function 2 combined together?
● Data Encapsulation
● Data Hiding
● Polymorphism
● Inheritance

Ans Polymorphism

(1Mark for mentioning the correct concept name )


(ii) How many times the message ​ ”Fiction removed!”will be displayed after 1
executing the above C++ code? Out of Line 1 to Line 9, which line is responsible to
display the message ​
”Fiction removed!”?

Page 8 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

Ans 2 times
Line 9

( ½ Mark for writing correct number of times)


( ½ Mark for writing correct line number)

(c) Write the definition of a class METROPOLIS in C++ with following description: 4
Private Members
­ Mcode //Data member for Code (an integer)
­ MName //Data member for Name (a string)
­ MPop //Data member for Population (a long int)
­ Area //Data member for Area Coverage (a float)
­ PopDens //Data member for Population Density (a float)
­ CalDen() //A member function to calculate ­­­­­­­
//Density as PopDens/Area
Public Members
­ Enter() //A function to allow user to enter values of
//Mcode,MName,MPop,Area and call CalDen()
//function
­ ViewALL()//A function to display all the data members
//also display a message ”Highly Populated Area”
//if the Density is more than 12000

Ans class METROPOLIS


{
int Mcode;
char MName[20];
long int MPop;
float Area;
float PopDens;
void CalDen();
public:
void Enter();
void ViewALL();

void METROPOLIS::Enter()
{
cin>>Mcode;
gets(MName); //​OR​cin>>MName;
cin>>MPop;
cin>>Area;
CalDen();

Page 9 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

void METROPOLIS::ViewALL()
{
cout<<Mcode<<MName<<MPop<<Area<<PopDens; //Ignore endl
if(PopDens>12000)
cout<<”Highly Populated Area”; //Ignore endl
}
void METROPOLIS::CalDen()
{
PopDens= PopDens/Area; //​OR​PopDens = MPop/Area
}

(½ Mark for correct syntax for class header)


(½ Mark for correctly ending the class declaration with a semicolon)
(½ Mark for correct declaration of data members)
(½ Mark for correct definition of CalDen() function)
(1 Mark for correct definition of Enter() with proper invocation of
CalDen() function)
(1 Mark for correct definition of ViewALL())

NOTE:
● Deduct ½ Mark if CalDen() is not invoked properly inside Enter()
function
● Marks not to be deducted if any or all the member functions are
defined inside the class
● Marks not to be deducted if ​ Densityis declared as an extra data
member and calculated as ​ Density=PopDens/Area inside
CalDen()​ function
● Marks not to be deducted if ​ Densityis declared as an extra data
member and checked as ​ if (Density>12000)in lieu of
if (PopDens>12000) ​ inside ​ function
ViewALL()​

(d) Answer the questions (i) to (iv) based on the following: 4


class PRODUCT
{
int Code;
char Item[20];
protected:
float Qty;
public:
PRODUCT();

Page 10 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

void GetIn(); void Show();



class WHOLESALER
{
int WCode;
protected:
char Manager[20];
public:
WHOLESALER();
void Enter();
void Display();

class SHOWROOM : public PRODUCT, private WHOLESALER
{
char Name[20],City[20];
public:
SHOWROOM();
void Input();
void View();

(i) Which type of Inheritance out of the following is illustrated in the above example?
− Single Level Inheritance
− Multi Level Inheritance
− Multiple Inheritance

Ans Multiple Inheritance


(1 Mark for writing correct option)
(ii) Write the names of all the data members, which are directly accessible from the
member functions of class SHOWROOM.

Ans Name, City, Manager, Qty


(1 Mark for correct answer)

Note:
No marks to be awarded for any partial answer
(iii) Write the names of all the member functions, which are directly accessible by an
object of class SHOWROOM.

Ans Input(), View(), GetIn(), Show()

Page 11 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

(1 Mark for correct answer)

Note:
● No marks to be awarded for any partial answer
● Ignore constructor functions
(iv) What will be the order of execution of the constructors, when an object of class
SHOWROOM is declared?

Ans (i) PRODUCT()


(ii) WHOLESALER()
(iii) SHOWROOM()

(1 Mark for writing correct order)


Note:
● No Marks to be awarded for any other combination/order.
● Names of the constructor/class without parenthesis is acceptable.

3 (a) Write the definition of a function FixPay(float Pay[], int N) in C++, which should 2
modify each element of the array Pay having N elements, as per the following
rules:
Existing Value of Pay Pay to be changed to
If less than 100000 Add 25% in the existing value
If >=100000 and <20000 Add 20% in the existing value
If >=200000 Add 15% in the existing value

Ans ​oid FixPay(float Pay[ ], int N)


v
{
for (int i=0;i<N;i++)
if(Pay[i]<100000)
Pay[i]+= 0.25 * Pay[i];
else if (Pay[i]>=100000 && Pay[i]<20000)
Pay[i]+= 0.2 * Pay[i];
else if(Pay[i]>=200000)
Pay[i]+= 0.15 * Pay[i];
}
OR
Any other correct equivalent function definition

( ½ Mark for correctly writing the loop)

Page 12 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

( ½ Mark for checking at least one or all of the conditions correctly)


( 1 Mark for correct increment of Pays for all conditions)
OR
( ½ Mark for incrementing only one of the pays correctly)

Note:
● Marks not to be deducted for writing second condition check for
the range as ​>=100000 && <​ 200000 ​instead of >=100000 &&
<​
20000
● Marks not to be deducted for incrementing Salary as
Pay[i]+= Pay[i]*20/100; ​ OR​Pay[i]+= 20/100*Pay[i];
and likewise for all increments
(b) T[20][50] is a two dimensional array, which is stored in the memory along the row 3
with each of its element occupying 4 bytes, find the address of the element
T[15][5], if the element T[10][8] is stored at the memory location 52000.

Ans
​ Loc(T[I][J])
=BaseAddress + W [( I – LBR)*C + (J – LBC)]
(where
W=size of each element = 4 bytes,
R=Number of Rows=20, C=Number of Columns=50)
Assuming LBR = LBC = 0

LOC(T[10][8])
52000 = BaseAddress + W[ I*C + J]
52000 = BaseAddress + 4[10*50 + 8]
52000 = BaseAddress + 4[500 + 8]
52000 = BaseAddress + 4 x 508
BaseAddress = 52000 ­ 2032
= 49968

LOC(T[15][5])= BaseAddress + W[ I*C + J]


= 49968 + 4[15*50 + 5]
= 49968 + 4[750 + 5]
= 49968 + 4 x 755
= 49968 + 3020
= 52988
OR
Loc(T[I][J])
=ReferenceAddress + W [( I – LR)*C + (J – LC)]
(where

Page 13 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

W=size of each element = 4 bytes,


R=Number of Rows=20, C=Number of Columns=50)
ReferenceAddress= Address of given cell T[10][8]=52000
LR = Row value of given cell = 10
LC = Column value of given cell = 8
LOC(T[15][5])= LOC(T[10][8]) + 4[(15 ­ 10)*50 + (5 ­ 8)]

LOC(T[15][5]) = 52000 + 4[5*50 + (­3)]


= 52000 + 4[250 ­3]
= 52000 + 4 x 247
= 52000 + 988
= 52988

(1 Mark for writing correct formula (for Row major) OR substituting


formula with correct values)
(1Mark for correct calculation )
(1 Mark for final correct address)
(c) Write the definition of a member function INSERT() for a class QUEUE in C++, to 4
insert an ITEM in a dynamically allocated Queue of items considering the following
code is already written as a part of the program.
struct ITEM
{
int INO; char INAME[20];
ITEM *Link;

class QUEUE
{
ITEM *R,*F;
public:
QUEUE(){R=NULL;F=NULL;}
void INSERT();
void DELETE();
~QUEUE();

Ans void QUEUE::INSERT()


{

Page 14 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

ITEM *T = new ITEM;


cin>>T­>INO;
gets(T­>INAME); //OR cin>> T­>INAME;
T­>Link = NULL;
if(R==NULL)
{
F=T; R=T;
}
else
{
R­>Link=T; R=T;
}
}
( 1 Mark for creating a new node)
( ½ Mark for entering data for the new node)
( ½ Mark for assigning NULL to link of the new node)
( ½ Mark for assigning Front to the first node as F = T)
( ½ Mark for linking the last node to the new node as R‐>Link =T)
( 1 Mark for assigning Rear to the new node as R = T)

(d) Write definition for a function SHOWMID(int P[][5],int R,int C) in C++ to display the 3
elements of middle row and middle column from a two dimensional array P having
R number of rows and C number of columns.
For example, if the content of array is as follows:
115 112 116 101 125
103 101 121 102 101
185 109 109 160 172

The function should display the following as output :


103 101 121 102 101
116 121 109

ANS void SHOWMID(int P[][5],int R,int C)


{
for (int J=0;J<C;J++)
cout<<P[R/2][J]<< “ “;
cout<<endl;
for (int I=0;I<R;I++)

Page 15 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

cout<<P[I][C/2]<< “ “;
}
OR
void SHOWMID(int P[][5],int R,int C)
{
if(R%2!=0)
{
for (int J=0;J<C;J++)
cout<<P[R/2][J]<< “ “;
}
else
cout<<”No Middle Row”;
cout<<endl;
if(C%2!=0)
{
for (int I=0;I<R;I++)
cout<<P[I][C/2]<< “ “;
}
else
cout<<”No Middle Column”;
}
OR
Any other correct equivalent function definition

( ½ Mark for correct loop for displaying middle row elements)


( 1 Mark for correct statement to display middle row elements)
( ½ Mark for correct loop for displaying middle column elements)
( 1 Mark for correct statement to display middle column elements)
(e) Convert the following Infix expression to its equivalent Postfix expression, showing 2
the stack contents for each step of conversion.
A/(B+C)*D­E

Ans A/(B+C)*D­E
= (((A / (B+C)) * D) ­ E)

Element Stack of Operators Postfix Expression


(

Page 16 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

(
(
A A
/ / A
( / A
B / AB
+ /+ AB
C /+ ABC
) / ABC+
) ABC+/
* * ABC+/
D * ABC+/D
) ABC+/D*
­ ­ ABC+/D*
E ­ ABC+/D*E
) ABC+/D*E­
= ABC+/D*E­

OR
A/(B+C)*D­E
= (A / (B+C) * D ­ E)
Element Stack of Operators Postfix Expression
( (
A ( A
/ (/ A
( (/( A
B (/( AB
+ (/(+ AB
C (/(+ ABC
) (/ ABC+
* (* ABC+/
D (* ABC+/D
­ (­ ABC+/D*
E (­ ABC+/D*E
) ABC+/D*E­
= ABC+/D*E­

Page 17 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

OR
Any other method for converting the given infix​​
expression to its
equivalent postfix expression showing stack contents.

(½ Mark for correctly converting till each operator)


OR
(1 Mark to be given for writing correct answer without showing the
stack content on each step)

4. (a) Write function definition for WORD4CHAR() in C++ to read the content of a text 2
file FUN.TXT, and display all those words, which has four characters in it.

Example:
If the content of the file fun.TXT is as follows:
When I was a small child, I used to play in the garden
with my grand mom. Those days were amazingly funful
and I remember all the moments of that time

The function WORD4CHAR() should display the following:


When used play with days were that time

Ans void WORD4CHAR()


{
ifstream Fil;
Fil.open(“FUN.TXT”);
char W[20];
Fil>>W;
while(!Fil.eof()) //OR while(Fil)
{
if (strlen(W)) == 4 ) ​
//Ignore words ending with ‘.’
cout<<W<< “ “;
Fil>>W;
}
Fil.close(); //Ignore
}
OR
Any other correct function definition

(½ Mark for opening FUN.TXT correctly)


(½ Mark for reading each word ​ from the file)
(using any method)​

Page 18 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

(½ Mark for checking length of the extracted word to be of 4 letters)


(½ Mark for displaying the 4 letter extracted word correctly)
(b) Write a definition for function BUMPER( ) in C++ to read each object of a binary 3
file GIFTS.DAT, find and display details of those gifts, which has remarks as “ÖN
DISCOUNT”. Assume that the file GIFTS.DAT is created with the help of objects of
class GIFTS, which is defined below:
class GIFTS
{
int ID;char Gift[20],Remarks[20]; float Price;
public:
void Takeonstock()
{
cin>>ID;gets(Gift);gets(Remarks);cin>>Price;
}
void See()
{
cout<<ID<<”:”<<Gift<<”:”<<Price<<””:”<<Remarks<<endl;
}
char *GetRemarks(){return Remarks;}

Ans void BUMPER()
{
GIFTS G;
ifstream fin;
fin.open(“GIFTS.DAT”, ios::binary);
while(fin.read((char*)&G, sizeof(G)))
{
if(strcmp(G.GetRemarks(),”ON DISCOUNT”)==0)
G.See();
}
fin.close(); //Ignore
}
OR
Any other correct function definition

(1Mark for opening GIFTS .DAT correctly)


(½ Mark for reading records from GIFTS.DAT)
(½ Mark for comparing Remarks with ON DISCOUNT (ignore case sensitive
checking))
(1 Mark for displaying record)

Page 19 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

(c) Find the output of the following C++ code considering that the binary file MEM.DAT 1
exists on the hard disk with a data of 1000 members.
class MEMBER
{
int Mcode;char MName[20];
public:
void Register();void Display();

void main()
{
fstream MFile;
MFile.open(“MEM.DAT”,ios::binary|ios::in);
MEMBER M;
MFile.read((char*)&M, sizeof(M));
cout<<”Rec:”<<MFile.tellg()/sizeof(M)<<endl;
MFile.read((char*)&M, sizeof(M));
MFile.read((char*)&M, sizeof(M));
cout<<”Rec:”<<MFile.tellg()/sizeof(M)<<endl;
MFile.close();
}
Ans Rec:1
Rec:3
(½ Mark for each correct value of MFile.tellg()/sizeof(M) as 1 and 3
respectively)
SECTION B ‐ (Only for candidates, who opted for Python)
1 (a) Out of the following, find those identifiers, which can not be used for naming 2
Variable or Functions in a Python program:

_Cost, Price*Qty, float, Switch,


Address One, Delete, Number12, do

Ans Price*Qty, float, Address One, do


(½ Mark for each correct name)
Note:
Deduct ½ Mark for each wrong name written
(b) Name the Python Library modules which need to be imported to invoke the 1
following functions
(i) ​load()
(ii) ​
pow()

Page 20 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

Ans (i) pickle


(ii) math
(½ Mark for writing each correct Library modules)

Note: Ignore any other Library modules, if mentioned.


(c) Rewrite the following code in python after removing all syntax error(s). Underline 2
each correction done in the code.
for Name in [Amar, Shveta, Parag]
IF Name[0]='S':
print(Name)
Ans for Name in [​
“​
Amar​
”​
,​“​
Shveta​
”​
,​“​
Parag​
”​
]​:​// ‘ ‘ can be used
if​Name[0] ​
==​‘S’:
print(Name)
(½ Mark for each correction)
OR
(1 mark for identifying the errors, without suggesting corrections)

(d) Find and write the output of the following python code: 2
Numbers=[9,18,27,36]
for Num in Numbers:
for N in range(1, Num%8):
print(N,"#",end=​
""​
)
print()

Ans
1# () ()
1# (1 # ) (1 # )
2# (1 #) (1 # 2 # )
1# (2 # ) (1 # 2 # 3 # )
2# (1 # )
3# (2 # ) 1#
(3 # ) 1#2#
1#2#3#

(2 marks for correct output)


OR
(½ mark for each correct value with ‘#’ not exceeding 2 Marks)
OR

Page 21 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

(2 mark for mentioning the syntax error in line


print(N,"#",end=​
""​)
)​
(e) Find and write the output of the following python code: 3
class Notes:
def __init__(self,N=100,Nt="CBSE"): #constructor
self.Nno=N
self.NName=Nt
def Allocate(self, N,Nt):
self.Nno= self.Bno + N
self.NName= Nt + self.NName
def Show(self):
print(self.Nno,"#",self.NName)
s=Notes()
t=Notes(200)
u=Notes(300,"Made Easy")
s.Show()
t.Show()
u.Show()
s.Allocate(4, "Made ")
t.Allocate(10,"Easy ")
u.Allocate(25,"Made Easy")
s.Show()
t.Show()
u.Show()

Ans
Python 2.7 output Other Versions output

100 # CBSE (100, '#', ‘CBSE’)


200 # CBSE (200, '#', ‘CBSE’)
300 # Made Easy (300, '#', ‘Made Easy’)
104 # Made CBSE (104, '#', ‘Made CBSE’)
210 # Easy CBSE (210, '#', ‘Easy CBSE’)
325 # Made EasyMade Easy (325, '#', ‘Made EasyMade Easy’)

(½ Mark for each correct line of output)


Note:
●Deduct ​½ Mark for not writing any or all ‘#’ symbol(s)
●Deduct ​½ Mark for not considering any or all line breaks at proper
place(s)
(f) What are the possible outcome(s) executed from the following code? Also specify 2
the maximum and minimum values that can be assigned to variable PICKER.

Page 22 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

import random
PICK=random.randint(0,3)
CITY=["DELHI","MUMBAI","CHENNAI","KOLKATA"];
for I in CITY:
for J in range(1,PICK):
print(I,end="")
print()

(i) (ii)
DELHIDELHI DELHI
MUMBAIMUMBAI DELHIMUMBAI
CHENNAICHENNAI DELHIMUMBAICHENNAI
KOLKATAKOLKATA
(iii) (iv)
DELHI DELHI
MUMBAI MUMBAIMUMBAI
CHENNAI KOLKATAKOLKATAKOLKATA
KOLKATA

Ans Option (i) and (iii) are possible

OR

Option (i) only

PICK maxval=3 minval=0

(1 Mark for mentioning correct option(s))


Note: No marks to be awarded for writing any other option.

(½ Mark each for Minimum and Maximum Value of PICK)

2 (a) What is the difference between Multilevel and Multiple inheritance? Give suitable 2
examples to illustrate both.
Ans
Multilevel inheritance Multiple inheritance

Page 23 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

X is the parent class of Y and Y is the The child class Z has parents X and Y
parent class of Z

( 1 mark for correct difference)


(1 mark for correct example)
(b) What will be the output of the following python code considering the following set 2
of inputs?
JAYA
My 3 books
PICK2
2120

Also, explain the try and except used in the code.


Counter=0
while True:
try:
Number=int(raw_input(“Give a Number”))
break
except ValueError:
Counter=Counter+2
print(“Re­enter Number”)
print(Counter)

Ans Output:
Give a Number JAYA
Re­enter Number
Give a Number My 3 books
Re­enter Number
Give a Number PICK2
Re­enter Number

Page 24 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

Give a Number 2120


6

Explanation: The code inside try makes sure that the valid number is entered by
the user. When any input other than an integer is entered, a value error is thrown
and it prompts the user to enter another value.

(½ mark for correct output for text entry)


(½ mark for correct output for number entry)
(1 mark for correct explanation of try and except)

(c) Write a class CITY in Python with following specifications 4


Instance Attributes
­ Code # Numeric value
­ Name # String value
­ Pop # Numeric value for Population
­ KM # Numeric value
­ Density # Numeric value for Population Density

Methods:
­ CalDen() # Method to calculate Density as Pop/KM
­ Record() # Method to allow user to enter values
Code,Name,Pop,KM and call CalDen() method
­ See() # Method to display all the members also display
a message ”Highly Populated Area”
if the Density is more than 12000.

Ans class CITY:


def __init__(self):
self.Code = 0
self.Name = “”
self.Pop = 0
self.KM =0
self.Density=0
def CalDen(self):
self.Density = self.Pop / self.KM
def Record(self):
self.Code = input(“Enter Code”)
self.Name = raw_input(“Enter Name”)
self.Pop = input(“Enter population”)
self.KM = input(“Enter KM”)
CalDen(self) // or self.CalDen()
def See(self):

Page 25 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

print Code,Name,Pop, KM, Density


if self.Density > 12000:
print(“Highly Populated Area”)
# OR print(“Highly populated Area”)
Note: Accept self.__Code to indicate private members

(½ Mark for correct syntax for class header)


(1 Mark for correct declaration of instance attributes)
(½ Mark for correct definition of CalDen() function)
(1 Mark for correct definition of Record() with proper invocation of
CalDen() function)
(1 Mark for correct definition of See())

NOTE:
Deduct ½ Mark if CalDen() is not invoked properly inside Record()
function
(d) How do we implement abstract method in python? Give an example for the same. 2
Ans Abstract method: An unimplemented method is called an abstract method. When
an abstract method is declared in a base class, the derived class has to either
define the method or raise “NotImplementedError”

class Shape(object):
def findArea(self):
pass
class Square(Shape):
def __init__(self,side):
self.side = side
def findArea(self):
return self.side * self.side

( 1 mark for correct explanation)


( 1 mark for correct example)
Note : We can use @abstractmethod to enable parent class method to
be executed.

(e) What is the significance of super() method? Give an example for the same. 2

Ans super() function is used to call base class methods which has been extended in
derived class.
EX:

class​
GradStudent​
​ (​
Student​
):

Page 26 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

def​
​ __init__​
​ (​
self​
):
super​
​ (​
GradStudent​ ,​self​
​ ).​
__init__​
()
self​
​ .​
subject​=​
​ ""

self​
​ .​
working​ =​
​ ''

def​
​ readGrad​
​ (​
​self​
):
# Call readStudent method of parent class

super​
​ (​
GradStudent​ ,​self​
​ ).​
readStudent​()

( 1 mark for correct explanation)


( 1 mark for correct example)

3. (a) What will be the status of the following list after the First, Second and Third pass 3
of the insertion sort method used for arranging the following elements in
descending order?
22, 24, ­64, 34, 80, 43
Note: Show the status of all the elements after each pass very clearly underlining
the changes.
Ans

( 1 mark for each correct pass)


(b) For a given list of values in descending order, write a method in python to search 2
for a value with the help of Binary Search method. The method should return
position of the value and should return ‐1 if the value not present in the list.
Ans def binarysrch(nums,x):
high = len(nums)
low =0
while low < high:
mid = (low + high)//2
midval = nums[mid]
if midval > x:
low = mid + 1
elif midval < x:
high = mid
else:
return mid
return ­1
( ½ mark for assignment of high/ub and low/lb)
( ½ mark for appropriate looping condition)

Page 27 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

( ½ mark for calculation of Mid)


( ½ mark for changing high/ub and low/lb)
(c) Write Insert(Place) and Delete(Place) methods in python to add Place and Remove 4
Place considering them to act as Insert and Delete operations of the data structure
Queue.
Ans class queue:
place = [ ]
def insert(self):
a = raw_input(“Enter place”)
queue.place.append(a)
def delete(self):
if (queue.place == [ ] ):
print “Queue empty”
else:
print “Deleted element is”, queue.place[0]
queue.place.delete()
OR

class queue:
place = [ ]
def insert(self):
a = raw_input(“Enter place”)
queue.place.append(a)
def delete(self):
if (queue.place == [ ] ):
print(“Queue empty”)
else:
print(“Deleted element is”, queue.place[0])
queue.place.delete()
( ½ mark insert header)
( ½ mark for accepting a value from user)
( ½ mark for adding value in list)
( ½ mark for delete header)
( ½ mark for checking empty list condition)
( ½ mark for displaying “Empty Message”)
(d) Write a method in python to find and display the prime numbers between 2 to N. 3
Pass N as argument to the method.
Ans def prime(N):
for a in range(2,N):
for I in range(2,a):
if N%i ==0:
break

Page 28 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

print a

OR
def prime(N):
for a in range(2,N):
for I in range(2,a):
if a%i ==0:
break
else:
print a
( ½ mark function header) ½ mark for Divisibility check.
( ½ mark first loop) 01 mark for Displaying view.
( ½ mark for second loop)
(e) Evaluate the following postfix notation of expression. Show status of stack after 2
every operation.
22,11,/,14,10,­,+,5,­

Ans
Element Stack
22 22
11 22, 11
/ 2
14 2, 14
10 2, 14, 10
- 2, 4
+ 6
5 6, 5
- 1

Final Result = 1
(½ Mark for evaluation till each operator)
OR
(1 Mark for only writing the Final answer without showing stack status)
4 (a) Write a statement in Python to perform the following operations: 1
● To open a text file “BOOK.TXT” in read mode
● To open a text file “BOOK.TXT” in write mode
Ans f1 = open(“BOOK.TXT”,’r’)
f2 = open(“BOOK.TXT”, ‘w’)

Page 29 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

( ½ Mark for each correct statement)


(b) Write a method in python to write multiple line of text contents into a text file 2
myfile.txt line.
Ans ​
def writel():
f = open(“myfile.txt”,’w’)
while True:
line = raw_input(“Enter line”)
f.write(line)
choice = raw_input(“Are there more lines”)
if choice == ‘N’:
break;
f.close()

Note: Using writelines() is also correct

(½ Mark for opening file in appropriate mode)


(½ Mark for end of file check and loop)
(½ Mark for taking input from user)
(½ Mark for writing the line into the file)
(c) Consider the following definition of class Staff, write a method in python to search 3
and display the content in a pickled file staff.dat, where Staffcode is matching
with ‘S0105’.

class Staff:
def __init__(self,S,SNM):
self.Staffcode=S
self.Name=SNM
def Show(self):
print(self.Staffcode," ­ ",self.Name)
Ans def search():
f = open(“staff.dat”, ‘rb’)
try:
while True:
e = pickle.load(f)
if e.Staffcode == ‘S0105’:
e.Show()
except EOFError:
pass
f.close()
(½ Mark for correct function header)
(½ Mark for opening the file staff.dat correctly)
(½ Mark for correct file check and loop)

Page 30 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

(½ Mark for correct load())


(½ Mark for correct checking of Staffcode)
(½ Mark for displaying the record)

SECTION C ‐ (For all the candidates)


5 (a) Observe the following STUDENTS and EVENTS tables carefully and write the name 2
of the RDBMS operation which will be used to produce the output as shown in LIST
? Also, find the Degree and Cardinality of the LIST.

STUDENTS EVENTS
NO NAME EVENTCODE EVENTNAME
1 Tara Mani 1001 Programming
2 Jaya Sarkar 1002 IT Quiz
3 Tarini Trikha

LIST
NO NAME EVENTCODE EVENTNAME
1 Tara Mani 1001 Programming
1 Tara Mani 1002 IT Quiz
2 Jaya Sarkar 1001 Programming
2 Jaya Sarkar 1002 IT Quiz
3 Tarini Trikha 1001 Programming
3 Tarini Trikha 1002 IT Quiz

Ans Cartesian Product

Degree = 4
Cardinality = 6

(1 Mark for writing the correct name of RDBMS operation)


(½ Mark for writing correct value of degree)
(½ Mark for writing correct value of cardinality)
(b) Write SQL queries for (i) to (iv) and find outputs for SQL queries (v) to (viii), 6
which are based on the tables

Table: VEHICLE
CODE VTYPE PERKM
101 VOLVO BUS 160

Page 31 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

102 AC DELUXE BUS 150


103 ORDINARY BUS 90
105 SUV 40
104 CAR 20
Note:
● PERKM is Freight Charges per kilometer
● VTYPE is Vehicle Type
Table: TRAVEL
NO NAME TDATE KM CODE NOP
101 Janish Kin 2015­11­13 200 101 32
103 Vedika Sahai 2016­04­21 100 103 45
105 Tarun Ram 2016­03­23 350 102 42
102 John Fen 2016­02­13 90 102 40
107 Ahmed Khan 2015­01­10 75 104 2
104 Raveena 2016­05­28 80 105 4
106 Kripal Anya 2016­02­06 200 101 25
Note:
● NO is Traveller Number
● KM is Kilometer travelled
● NOP is number of travellers travelled in vehicle
● TDATE is Travel Date

(i) To display NO, NAME, TDATE from the table TRAVEL in descending order of NO.

Ans SELECT NO, NAME, TDATE FROM TRAVEL


ORDER BY NO DESC;

​ELECT NO, NAME, TDATE FROM TRAVEL​


(½ Mark for S )
(½ Mark for ​ )
ORDER BY NO DESC​
(ii) To display the NAME of all the travellers from the table TRAVEL who are
traveling by vehicle with code 101 or 102.

Ans SELECT NAME FROM TRAVEL


WHERE CODE=‘101’ OR CODE=’102’;
OR
SELECT NAME FROM TRAVEL
WHERE CODE=101 OR CODE=102;

Page 32 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

OR
SELECT NAME FROM TRAVEL
WHERE CODE IN (‘101’,’102’);
OR
SELECT NAME FROM TRAVEL
WHERE CODE IN (101,102);
(½ Mark for correct ​ )
SELECT​
​HERE ​
(½ Mark for correct W )
(iii) To display the NO and NAME of those travellers from the table TRAVEL who
travelled between ‘2015‐12‐31’ and ‘2015‐04‐01’.

Ans SELECT NO, NAME from TRAVEL


WHERE TDATE >= ‘2015­04­01’ AND TDATE <= ‘2015­12­31’;
OR
SELECT NO, NAME from TRAVEL
WHERE TDATE BETWEEN ‘2015­04­01’ AND ‘2015­12­31’;
OR
SELECT NO, NAME from TRAVEL
WHERE TDATE <= ‘2015­12­31’ AND TDATE >= ‘2015­04­01’;
OR
SELECT NO, NAME from TRAVEL
WHERE TDATE BETWEEN ‘2015­12­31’ AND ‘2015­04­01’;

(½ Mark for correct ​ )


SELECT​
​HERE ​
(½ Mark for correct W )
(iv) To display all the details from table TRAVEL for the travellers, who have
travelled distance more than 100 KM in ascending order of NOP.

Ans SELECT * FROM TRAVEL


WHERE KM > 100 ORDER BY NOP;
(½ Mark for correct ​ )
SELECT​
​HERE ​
(½ Mark for correct W )
(v) SELECT COUNT(*),CODE FROM TRAVEL
GROUP BY CODE HAVING COUNT(*)>1;

Ans COUNT(*)​ ​ CODE


2 101
2 102
(½ Mark for correct output)

Page 33 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

(vi) SELECT DISTINCT CODE FROM TRAVEL;

Ans DISTINCT CODE


101
102
103
104
105
(½ Mark for correct output)
Note: Ignore the order
(vii) SELECT A.CODE,NAME,VTYPE
FROM TRAVEL A,VEHICLE B
WHERE A.CODE=B.CODE AND KM<90;

Ans CODE​ ​ NAME​ ​


VTYPE
104 Ahmed Khan CAR
105 Raveena SUV
(½ Mark for correct output)
(viii) SELECT NAME,KM*PERKM
FROM TRAVEL A,VEHICLE B
WHERE A.CODE=B.CODE AND A.CODE=’105’;

Ans NAME​ ​
KM*PERKM
Raveena 3200
(½ Mark for correct output)
6 a. Verify the following using Boolean Laws. 2
A’+ B’.C = A’.B’.C’+ A’.B.C’+ A’.B.C + A’.B’.C+ A.B’.C

Ans LHS
A’ + B’.C
= A’.(B + B’).(C + C’) + (A + A’).B’.C
= A’.B.C + A’.B.C’ + A’.B’.C + A’.B’.C’ + A.B’.C + A’.B’.C
= A’.B.C + A’.B.C’ + A’.B’.C + A’.B’.C’ + A.B’.C
= A’.B’.C’ + A’.B.C’ + A’.B.C + A’.B’.C + A.B’.C
= RHS
OR
RHS = A’.B’.C’ + A’.B.C’ + A’.B.C + A’.B’.C + A.B’.C
= A’.B’.C + A’.B’C’ + A’.B.C + A’.B.C’ + A.B’.C
= A’.B’.(C+C’) + A’.B.(C+C’) + A.B’.C
= A’.B’ + A’.B + A.B’.C
= A’.(B’+B) +A.B’.C

Page 34 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

= A’ + A.B’.C
= (A’ + A).(A’ + B’.C)
= A’ + B’.C = LHS

(2 Marks for correct Verification)


OR
(1 Mark for expanding LHS up to 1 correct step)
OR
(1 Mark for reducing RHS up to 1 correct step)
b. Write the Boolean Expression for the result of the Logic Circuit as shown below: 2

Ans ((U + V’).(U + W)). (V + W’)


OR
(U + V’).(U + W). (V + W’)

(2 Marks for correctly writing the full expression )


OR
(½ Mark each for correctly writing any one term)
c. Derive a Canonical POS expression for a Boolean function F, represented by the 1
following truth table:
P Q R F(P,Q,R)
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 1

Ans F(P,Q,R)=(P+Q+R).(P+Q’+R’).(P’+Q+R).(P’+Q+R’)
OR
F(P,Q,R)= ​
ᵴ​
(0,3,4,5)
(1 Mark for the correctly writing the POS form)

Page 35 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

Note: Deduct ½ mark if wrong variable names are used


d. Reduce the following Boolean Expression to its simplest form using K‐Map: 3

F(X,Y,Z,W)= (2,6,7,8,9,10,11,13,14,15)

Ans
OR

F(X,Y,Z,W) = XY’ + ZW’ + XW + YZ

( ½ Mark for drawing K‐Map with correct variable names)


( ½ Mark each for 4 groupings)
( ½ Mark for writing final expression in reduced/minimal form)

Note: Deduct ½ mark if wrong variable names are written in the


expression
7 (a) Give two examples of PAN and LAN type of networks. 1

Ans
PAN Examples LAN Examples
Connecting two cell phones to Connecting computers in a school
transfer data
Connecting smartphone to a smart Connecting computers in an office
watch
Note: Any one example of each
OR
Any other one/two correct examples for each of PAN and LAN

( ½ Mark for any one/two correct examples of PAN)


( ½ Mark for any one/two correct examples of LAN)
(b) Which protocol helps us to browse through web pages using internet browsers? 1
Name any one internet browser.

Page 36 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

Ans Protocol: HTTP OR​​ TCP/IP


Browser: ​Chrome ​OR Internet Explorer ​
OR Firefox ​
OR OPERA ​
OR ​
SAFARI
OR​any other correct Browser Name

(½ Mark for any one correct protocol name)


(½ Mark for any one correct browser name)
(c) Write two advantages of 4G over 3G Mobile Telecommunication Technologies in 1
terms of speed and services?

Ans
4G 3G
Speed approximately 100 mbps Speed approximately 2 mbps
LTE True mobile broadband Data services with multimedia

OR
Any other two correct advantages of 4G over 3G in terms of speed and
services

( ½ Mark for each correct advantage)


(d) Write two characteristics of Web 2.0. 1

Ans ● Makes web more interactive through online social media


● Supports easy online information exchange
● Interoperability on the internet
● Video sharing possible in the websites
OR
Any two of the above or any other two correct characteristics of Web 2.0

(​ )
½ Mark each for any two correct characteristics​
(e) What is the basic difference between Trojan Horse and Computer Worm? 1

Ans
Trojan Horse Computer Worm
It is a "Malware" computer program It is a self‐replicating computer
presented as useful or harmless in program. It uses a network to send
order to induce the user to install and copies of itself to other nodes
run them. (computers on the network) and it
may do so without any user
intervention.

Page 37 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

OR
Any other correct difference between Trojan Horse and Computer Worm
(1 Mark for writing correct difference between Trojan Horse and
Computer Worm)
OR
(½ Mark for writing correct explanation of Trojan Horse)
OR
(½ Mark for writing correct explanation of Computer Worm)
(f) Categories the following under Client side and Server Side script category? 1
(i) VB Sript
(ii) ASP
(iii) JSP
(iv) Java Script

Ans
Client Side Scripts Server Side Scripts
VB Script ASP
Java Script JSP

(1 Mark for correct answer)


OR
(½ Mark for any two correct client/server side script names)
(g) Uplifting Skills Hub India is a knowledge and skill community which has an aim to
uplift the standard of knowledge and skills in the society. It is planning to setup its
training centers in multiple towns and villages pan India with its head offices in
the nearest cities. They have created a model of their network with a city, a town
and 3 villages as follows.
As a network consultant, you have to suggest the best network related solutions
for their issues/problems raised in (i) to (iv), keeping in mind the distances
between various locations and other given parameters.

Page 38 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

Shortest distances between various locations:


VILLAGE 1 to B_TOWN 2 KM
VILLAGE 2 to B_TOWN 1.0 KM
VILLAGE 3 to B_TOWN 1.5 KM
VILLAGE 1 to VILLAGE 2 3.5 KM
VILLAGE 1 to VILLAGE 3 4.5 KM
VILLAGE 2 to VILLAGE 3 2.5 KM
A_CITY Head Office to B_HUB 25 Km

Number of Computers installed at various locations are as follows:


B_TOWN 120
VILLAGE 1 15
VILLAGE 2 10
VILLAGE 3 15
A_CITY OFFICE 6

Note:
● In Villages, there are community centers, in which one room has been
given as training center to this organization to install computers.
● The organization has got financial support from the government and top IT
companies.
(i) Suggest the most appropriate location of the SERVER in the B_HUB (out of the 4 1
locations), to get the best and effective connectivity. Justify your answer.
Ans B_TOWN. Since it has the maximum number of computers and is closest to all
other locations.

Page 39 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91/1 Delhi)

(½ Mark for writing correct location name)


(½ Mark for writing any one correct justification)
(ii) Suggest the best wired medium and draw the cable layout (location to location) to 1
efficiently connect various locations within the B_HUB.
Ans Best Wired Medium : Optical Fibre

(½ Mark for writing the correct best wired medium name)


(½ Mark for drawing the correct cable layout)
(iii) Which hardware device will you suggest to connect all the computers within each 1
location of B_HUB?

Ans Switch OR Hub

(1 Mark for writing any one of the above answers)


(iv) Which service/protocol will be most helpful to conduct live interactions of Experts 1
from Head Office and people at all locations of B_HUB?

Ans Videoconferencing OR VoIP OR any other correct service/protocol

(1 Mark for writing any one of the above answers)

Page 40 of 40
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

General Instructions:
● The answers given in the marking scheme are SUGGESTIVE, Examiners are
requested to award marks for all alternative correct Solutions/Answers
conveying the similar meaning
● All programming questions have to be answered with respect to C++/Python
Language only
● In C++/Python , ignore case sensitivity for identifiers (Variable / Functions /
Structures / Class Names)
● In Python indentation is mandatory, however, number of spaces used for
indenting may vary
● In SQL related questions – both ways of text/character entries should be
acceptable for Example: “AMAR” and ‘amar’ both are acceptable.
● In SQL related questions – all date entries should be acceptable for Example:
‘YYYY‐MM‐DD’, ‘YY‐MM‐DD’, ‘DD‐Mon‐YY’, “DD/MM/YY”, ‘DD/MM/YY’,
“MM/DD/YY”, ‘MM/DD/YY’ and {MM/DD/YY} are correct.
● In SQL related questions – semicolon should be ignored for terminating the SQL
statements
● In SQL related questions, ignore case sensitivity.

SECTION A ‐ (Only for candidates, who opted for C++)


1. (a) Out of the following, find those identifiers, which can not be used for naming 2
Variable, Constants or Functions in a C++ program:
Total*Tax, double, Case, My Name,
NeW, switch, Column31, _Amount
Ans Total*Tax
double
My Name
switch
(½ Mark for each correct name)
Note:
Deduct ½ Mark for each wrong name written
(b) Ronica Jose has started learning C++ and has typed the following program. When 1
she compiled the following code written by her, she discovered that she needs to
include some header files to successfully compile and execute it. Write the names
of those header files, which are required to be included in the code.
void main()
{
double X,Times,Result;
cin>>X>>Times;
Result=pow(X,Times);
cout<<Result<<endl;
}

Page 1 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

Ans ● iostream.h OR iomanip.h


● math.h

(½ Mark for writing each correct header file)


Note:
● Ignore any other header files, if mentioned.
● ​
is acceptable in place of math.h
complex.h​
(c) Rewrite the following C++ code after removing any/all syntactical errors with each 2
correction underlined.

Note: Assume all required header files are already being included in the program.

#define Formula(a,b) = 2*a+b


void main()
{
float X=3.2;Y=4.1;
Z=Formula(X,Y);
cout<<’Result=’<<Z<<endl;
}
Ans #define Formula(a,b) 2*a+b
void main()
{
float X=3.2​, ​
Y=4.1;
float​Z=Formula(X,Y);

cout<<​
”Result=”​
<<Z<<endl;
}
(½ Mark for each correction)
OR
(1 mark for identifying the errors, without suggesting corrections)
(d) Find and write the output of the following C++ program code: 2
Note: Assume all required header files are already included in the program.
typedef char TEXT[80];
void JumbleUp(TEXT T)
{
int L=strlen(T);
for (int C=0;C<L­1;C+=2)
{
char CT=T[C];
T[C]=T[C+1];

Page 2 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

T[C+1]=CT;
}
for (C=1;C<L;C+=2)
if (T[C]>=’M’ && T[C]<=’U’)
T[C]=’@’;
}
void main()
{
TEXT Str=”HARMONIOUS”;
JumbleUp(Str);
cout<<Str<<endl;
}
Ans AHM@N@OIS@

(2 Marks for correct output)


OR
(½ Mark for each of two correct consecutive characters not exceeding
1½ marks)
(e) Find and write the output of the following C++ program code: 3
Note: Assume all required header files are already being included in the program.
class Share
{
long int Code;
float Rate;
int DD;
public:
Share(){Code=1000;Rate=100;DD=1;}
void GetCode(long int C,float R)
{
Code=C;
Rate=R;
}
void Update(int Change,int D)
{
Rate+=Change;
DD=D;
}
void Status()
{
cout<<”Date:”<<DD<<endl;
cout<<Code<<”#”<<Rate<<endl;
}

Page 3 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

void main()
{
Share S,T,U;
S.GetCode(1324,350);
T.GetCode(1435,250);
S.Update(50,28);
U.Update(­25,26);
S.Status();
T.Status();
U.Status();
}
Ans Date:28
1324#400
Date:1
1435#250
Date:26
1000#75

(½ Mark for each correct line of output)


Note:
●Deduct only ​
½ Mark for not writing any or all ‘Date’ OR ‘:’ OR ‘#’
symbol(s)
●Deduct ​½ Mark for not considering any or all endl(s) at proper
place(s)
(f) Look at the following C++ code and find the possible output(s) from the options (i) 2
to (iv) following it. Also, write the maximum and the minimum values that can be
assigned to the variable PICKER.
Note:
‐ Assume all the required header files are already being included in the code.
‐ The function random(n) generates an integer between 0 and n‐1
void main()
{
randomize();
int PICKER;
PICKER=1+random(3);
char COLOR[][5]={”BLUE”,”PINK”,”GREEN”,”RED”};
for(int I=0;I<=PICKER; I++)
{
for(int J=0; J<=I;J++)
cout<<COLOR[J];
cout<<endl;
}
}

Page 4 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

(i) (ii) (iii) (iv)


PINK BLUE GREEN BLUE
PINKGREEN BLUEPINK GREENRED BLUEPINK
PINKGREENRED BLUEPINKGREEN BLUEPINKGREEN
BLUEPINKGREENRED

Ans
(ii) (iv)
BLUE BLUE
BLUEPINK BLUEPINK
BLUEPINKGREEN BLUEPINKGREEN
BLUEPINKGREENRED

Minimum Value of PICKER = 1


Maximum Value of PICKER = 3

(1 Mark for mentioning both the correct options)


Note: No Mark to be awarded for writing any one additional option
with (ii) and (iv).
OR
(½ Mark for only (iv))

(½ Mark each for Minimum and Maximum Value of PICKER)


2 (a) Write any four important characteristics of Object Oriented Programming? Give 2
example of any one of the characteristics using C++.
Ans ● Encapsulation
● Data Hiding
● Polymorphism
● Inheritance

Example of Encapsulation
class student
{
int rno;
char name[20];
public:
void input()
{
cin>>rno;
gets(name);
}

Page 5 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

void output()
{
cout<<rno<<” “<<name<<endl;
}

The data members and member functions are wrapped up


together(encapsulated ) into a single unit called class.

OR
Any other suitable example demonstrating a characteristic of Object
Oriented Programming.

(​
1 Mark for correct names of 4 characteristics of OOP)
OR
(½ Mark for correct names of any 2 characteristics of OOP)

(​
1 Mark for correct example of 1 characteristic)
(b) Observe the following C++ code and answer the questions (i) and (ii). Assume all
necessary files are included:
class BOOK
{
long Code ;
char Title[20];
float Price;
public:
BOOK() //Member Function 1
{
cout<<”Bought”<<endl;
Code=10;strcpy(Title,”NoTitle”);Price=100;
}
BOOK(int C,char T[],float P) //Member Function 2
{
Code=C;
strcpy(Title,T);
Price=P;
}
void Update(float P) //Member Function 3
{
Price+=P;
}

Page 6 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

void Display() //Member Function 4


{
cout<<Code<<”:”<<Title<<”:”<<Price<<endl;
}

~BOOK() //Member Function 5


{
cout<<”Book Discarded!”<<end1;
}

void main() //Line 1
{ //Line 2
BOOK B,C(101,”Truth”,350}; //Line 3
for (int I=0;I<4;I++) //Line 4
{ //Line 5
B.Update(50);C.Update(20); //Line 6
B.Display();C.Display(); //Line 7
} //Line 8
} //Line 9
(i) Which specific concept of object oriented programming out of the following is 1
illustrated by Member Function 1 and Member Function 2 combined together?
● Data Encapsulation
● Polymorphism
● Inheritance
● Data Hiding
Ans Polymorphism

(1Mark for mentioning the correct concept name )



(ii) How many times the message ​ ”Book Discarded!” will be displayed after 1
executing the above C++ code? Out of Line 1 to Line 9, which line is
responsible to display the message ​
”Book Discarded!”
Ans 2 times
Line 9

( ½ Mark for writing correct number of times)


OR
( ½ Mark for writing ‐ “No execution due to wrong syntax in Line 3”
OR any other equivalent answer conveying similar meaning)

( ½ Mark for writing correct line number)

Page 7 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

(c) Write the definition of a class CITY in C++ with following description: 4

Private Members
­ Ccode //Data member for City Code (an integer)
­ CName //Data member for City Name (a string)
­ Pop //Data member for Population (a long int)
­ KM //Data member for Area Coverage (a float)
­ Density //Data member for Population Density (a float)
­ DenCal() //A member function to calculate ­­­
//Density as Pop/KM
Public Members
­ Record() //A function to allow user to enter values of
//Acode,Name,Pop,KM and call DenCal() function
­ View() //A function to display all the data members
//also display a message ”Highly Populated City”
//if the Density is more than 10000
Ans class CITY
{
int Ccode;
char CName[20];
long int Pop;
float KM;
float Density;
void DenCal();
public:
void Record();
void View();

void CITY::Record()
{
cin>>Ccode;
gets(CName); //​OR​cin>>CName;
cin>>Pop;
cin>>KM;
DenCal();
}
void CITY::View()
{

Page 8 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

cout<<Ccode<<CName<<Pop<<KM<<Density; //Ignore endl


if(Density>10000)
cout<<”Highly Populated City”; //Ignore endl
}
void CITY::DenCal()
{
Density= Pop/KM;
}
(½ Mark for correct syntax for class header)
(½ Mark for correctly ending the class declaration with ;)
(½ Mark for correct declaration of data members)
(½ Mark for correct definition of DenCal() function)
(1 Mark for correct definition of Record() with proper invocation of
DenCal() function)
(1 Mark for correct definition of View())
NOTE:
● Deduct ½ Mark if DenCal() is not invoked properly inside Record()
function
● Marks not to be deducted if any or all the member functions are
defined inside the class
(d) Answer the questions (i) to (iv) based on the following: 4
class ITEM
{
int Id;
char IName[20];
protected:
float Qty;
public:
ITEM();
void Enter(); void View();

class TRADER
{
int DCode;
protected:
char Manager[20];
public:
TRADER();
void Enter();
void View();

Page 9 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

class SALEPOINT : public ITEM,private TRADER


{
char Name[20],Location[20];
public :
SALEPOINT();
void EnterAll();
void ViewAll();

(i) Which type of Inheritance out of the following is illustrated in the above example?
‐ Single Level Inheritance
‐ Multi Level Inheritance
‐ Multiple Inheritance
Ans Multiple Inheritance

(1 Mark for writing correct option)


(ii) Write the names of all the data members, which are directly accessible from the
member functions of class SALEPOINT.
Ans Name, Location, Manager, Qty
(1 Mark for correct answer)

Note:
No marks to be awarded for any partial answer
(iii) Write the names of all the member functions, which are directly accessible by an
object of class SALEPOINT.
Ans EnterAll(), ViewAll(), Enter(), View()
(1 Mark for correct answer)

Note: No marks to be awarded for any partial answer


(iv) What will be the order of execution of the constructors, when an object of class
SALEPOINT is declared?
Ans (i) ITEM()
(ii) TRADER()
(iii) SALEPOINT()

(1 Mark for writing correct order)


● No Marks to be awarded for any other combination/order.
● Names of the constructor/class without parenthesis is acceptable

Page 10 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

3 (a) Write the definition of a function FixSalary(float Salary[], int N) in C++, which 2
should modify each element of the array Salary having N elements, as per the
following rules:
Existing Salary Values Required Modification in Value
If less than 100000 Add 35% in the existing value
If >=100000 and <20000 Add 30% in the existing value
If >=200000 Add 20% in the existing value

Ans ​
void FixSalary(float Salary[ ], int N)
{
for (int i=0;i<N;i++)
if(Salary[i]<100000)
Salary[i]+= 0.35 *Salary[i];
else if (Salary[i]>=100000 && Salary[i]<20000)
Salary[i]+= 0.3 * Salary[i];
else if(Salary[i]>=200000)
Salary[i]+= 0.20 * Salary[i];
}
OR
Any other correct equivalent function definition

( ½ Mark for correctly writing the loop)


( ½ Mark for correctly checking all conditions)
( 1 Mark for correct increment of Salary for all conditions)
OR
( ½ Mark for checking only one of the conditions correctly)
( ½ Mark for incrementing only one of the Salary correctly)

Note:
● Marks not to be deducted for writing second condition check for
the range as ​>=100000 && <​ instead of >=100000 &&
200000 ​
<​
20000
● Marks not to be deducted for incrementing Salary as
Salary[i]+=Salary[i]*20/100; ​ OR
Salary[i]+=20/100*Salary[i];
and likewise for all increments

(b) R[10][50] is a two dimensional array, which is stored in the memory along the row 3
with each of its element occupying 8 bytes, find the address of the element
R[5][15], if the element R[8][10] is stored at the memory location 45000.

Page 11 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

Ans
​ Loc(R[I][J])
=BaseAddress + W [( I – LBR)*C + (J – LBC)]
(where
W=size of each element = 8 bytes,
R=Number of Rows=10, C=Number of Columns=50)
Assuming LBR = LBC = 0
LOC(R[8][10])
45000 = BaseAddress + W[ I*C + J]
45000 = BaseAddress + 8[8*50 + 10]
45000 = BaseAddress + 8[400 + 10]
45000 = BaseAddress + 8 x 410
BaseAddress = 45000 ­ 3280
= 41720

LOC(R[5][15])= BaseAddress + W[ I*C + J]


= 41720 + 8[5*50 + 15]
= 41720 + 8[250 + 15]
= 41720 + 8 x 265
= 41720 + 2120
= 43840
OR
Loc(R[I][J])
=Reference Address + W [( I – LR)*C + (J – LC)]
(where
W=size of each element = 8 bytes,
R=Number of Rows=10, C=Number of Columns=50)
Reference Address= Address of given cell R[8][10]=45000
LR = Row value of given cell = 8
LC = Column value of given cell = 10
LOC(R[5][15])= LOC(T[8][10]) + 8[(5 ­ 8)*50 + (15 ­ 10)]
LOC(R[15][5]) = 45000 + 8[­3*50 + 5]
= 45000 + 8[­150 + 5]
= 45000 + 8 x (­145)
= 45000 ­ 1160
= 43840

(1 Mark for writing correct formula (for Row major) OR substituting


formula with correct values)
(1Mark for correct calculation )
(1 Mark for final correct address)

Page 12 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

(c) Write the definition of a member function DELETE() for a class QUEUE in C++, to 4
remove a product from a dynamically allocated Queue of products considering the
following code is already written as a part of the program.
struct PRODUCT
{
int PID; char PNAME[20];
PRODUCT *Next;

class QUEUE
{
PRODUCT *R,*F;
public:
QUEUE(){R=NULL;F=NULL;}
void INSERT();
void DELETE();
~QUEUE();

Ans void QUEUE::DELETE()
{
if( F!=NULL)
{
PRODUCT *T = F;
cout<<T­>PID<<T­>PNAME;
F=F­>Next;
delete T;
if(F==NULL)
{

R=NULL;
}
}
else
cout<<”Queue Empty”;
}
( ½ Mark for checking empty queue)
( ½ Mark for assigning front to temporary pointer)
( 1 Mark for reassigning front)
( 1 Mark for deleting previous front using temporary pointer)
( ½ Mark for checking emptied queue after deletion)
( ½ Mark for assigning rear to NULL if queue was emptied after
deletion)

Page 13 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

(d) Write definition for a function DISPMID(int A[][5],int R,int C) in C++ to display the 3
elements of middle row and middle column from a two dimensional array A having
R number of rows and C number of columns.
For example, if the content of array is as follows:
215 912 516 401 515
103 901 921 802 601
285 209 609 360 172

The function should display the following as output


103 901 921 802 601
516 921 609

ANS void DISPMID(int A[][5],int R,int C)


{
for (int J=0;J<C;J++)
cout<<A[R/2][J]<< “ “;
cout<<endl;
for (int I=0;I<R;I++)
cout<<A[I][C/2]<< “ “;
}

OR
void DISPMID(int A[][5],int R,int C)
{
if(R%2!=0)
{
for (int J=0;J<C;J++)
cout<<A[R/2][J]<< “ “;
}
else
cout<<”No Middle Row”;
cout<<endl;
if(C%2!=0)
{
for (int I=0;I<R;I++)
cout<<A[I][C/2]<< “ “;
}

Page 14 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

else
cout<<”No Middle Column”;
}
OR
Any other correct equivalent function definition

( ½ Mark for correct loop for displaying middle row elements)


( 1 Mark for correct statement to display middle row elements)
( ½ Mark for correct loop for displaying middle column elements)
( 1 Mark for correct statement to display middle column elements)
(e) Convert the following Infix expression to its equivalent Postfix expression, showing 2
the stack contents for each step of conversion.
P/(Q­R)*S+T
Ans P/(Q­R)*S+T​​
= (P / (Q­R) * S + T)
Element Stack of Operators Postfix Expression
( (
P ( P
/ (/ P
( (/( P
Q (/( PQ
­ (/(­ PQ
R (/(­ PQR
) (/ PQR­
* (* PQR­/
S (* PQR­/S
+ (+ PQR­/S*
T (+ PQR­/S*T
) PQR­/S*T+
= PQR­/S*T+
OR
P/(Q­R)*S+T = (((P / (Q­R)) * S) + T)
Element Stack of Operators Postfix Expression
(
(

Page 15 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

(
P P
/ /
(
Q PQ
­ /­
R PQR
) / PQR­
) PQR­/
* *
S PQR­/S
) PQR­/S*
+ +
T PQR­/S*T
) PQR­/S*T+

= PQR­/S*T+
OR
Any other method for converting the given infix​​
expression to its
equivalent postfix expression showing stack contents.

(½ Mark for correctly converting till each operator)


OR
(1 Mark to be given for writing correct answer without showing the
stack content on each step)
4. (a) Write function definition for DISP3CHAR() in C++ to read the content of a text file 2
KIDINME.TXT, and display all those words, which have three characters in it.
Example:
If the content of the file KIDINME.TXT is as follows:
When I was a small child, I used to play in the garden
with my grand mom. Those days were amazingly funful and
I remember all the moments of that time

The function DISP3CHAR() should display the following:


was the mom and all the

Page 16 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

Ans void DISP3CHAR()


{
ifstream Fil;
Fil.open(“KIDINME.TXT”);
char W[20];
Fil>>W;
while(!Fil.eof()) // OR while(Fil)
{
if (strlen(W)) == 3)
cout<<W<< “ “;
Fil>>W;
}
Fil.close(); //Ignore
}
OR
Any other correct function definition

(½ Mark for opening KIDINME.TXT correctly)


(½ Mark for reading each word ​ from the file)
(using any method)​
(½ Mark for checking length of the extracted word to be of 3 letters)
(½ Mark for displaying the 3 letter extracted word correctly)

Note:
No marks to be deducted if words with length 4 and including a ‘.’ is also
checked
(b) Write a definition for function ONOFFER( ) in C++ to read each object of a binary 3
file TOYS.DAT, find and display details of those toys, which has status as “ÖN
OFFER”. Assume that the file TOYS.DAT is created with the help of objects of class
TOYS, which is defined below:
class TOYS
{
int TID;char Toy[20],Status[20]; float MRP;
public:
void Getinstock()
{
cin>>TID;gets(Toy);gets(Status);cin>>MRP;
}
void View()
{
cout<<TID<<”:”<<Toy<<”:”<<MRP<<””:”<<Status<<endl;
}
char *SeeOffer(){return Status;}.

Page 17 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)


Ans void ONOFFER()
{
TOYS T;
ifstream fin;
fin.open(“TOYS.DAT”, ios::binary);
while(fin.read((char*)&T, sizeof(T)))
{
if(strcmp(T.SeeOffer(),”ON OFFER”)==0)
T.View();
}
fin.close(); //Ignore
}

OR
Any other correct function definition

(1Mark for opening TOYS .DAT correctly)


(½ Mark for reading records from TOYS.DAT)
(½ Mark for comparing Remarks with ON OFFER (ignore case sensitive
checking))
(1 Mark for displaying record)
(c) Find the output of the following C++ code considering that the binary file 1
CLIENT.DAT exists on the hard disk with a data of 1000 clients.
class CLIENT
{
int Ccode;char CName[20];
public:
void Register();void Display();

void main()
{
fstream CFile;
CFile.open(“CLIENT.DAT”,ios::binary|ios::in);
CLIENT C;
CFile.read((char*)&C, sizeof(C));
cout<<”Rec:”<<CFile.tellg()/sizeof(C)<<endl;
CFile.read((char*)&C, sizeof(C));
CFile.read((char*)&C, sizeof(C));
cout<<”Rec:”<<CFile.tellg()/sizeof(C)<<endl;
CFile.close();
}

Page 18 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

Ans Rec:1
Rec:3

(½ Mark for each correct value of CFile.tellg()/sizeof(C) as 1 and 3


respectively)
SECTION B ‐ (Only for candidates, who opted for Python)
1 (a) Out of the following, find those identifiers, which can not be used for naming 2
Variable or Functions in a Python program:

Total*Tax, While, class, switch,


3rdRow, finally, Column31, _Total

Ans Total*Tax, class, 3rdRow, finally


(½ Mark for each correct name)
Note:
Deduct ½ Mark for each wrong name written
(b) Name the Python Library modules which need to be imported to invoke the 1
following functions
(i) ​sqrt()
(ii) ​
dump()
Ans (i) math
(ii) pickle
(½ Mark for writing each correct Library modules)

Note: Ignore any other Library modules, if mentioned.


(c) Rewrite the following code in python after removing all syntax error(s). Underline 2
each correction done in the code.
for Name in [Ramesh,Suraj,Priya]
IF Name[0]='S':
print(Name)
Ans for Name in [​
“​
Ramesh​
”​
,​“​
Suraj​
”​
,​“​
Priya​
”​
]​:​// ‘ ‘ can be used
if​Name[0] ​
==​‘S’:
print(Name)

(½ Mark for each correction)


OR
(1 mark for identifying the errors, without suggesting corrections)
(d) Find and write the output of the following python code: 2

Page 19 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

Values=[10,20,30,40]
for Val in Values:
for I in range(1, Val%9):
print(I,"*",end=​
""​
)
print()

Ans
1* () ()
1* (1, * ) (1 * )
2* () (1 * 2 * )
1* (1 ,* ) (1 * 2 * 3 * )
2* (2 ,* )
3* () 1*
(1, * ) 1*2*
(2, * ) 1*2*3*
(3, * )
()

(2 marks for correct output)


OR
(½ mark for each correct value with ‘*’ not exceeding 2 Marks)
OR
(2 mark for mentioning the syntax error in line ​
print(I,"*",end=​
""​)
)​
(e) Find and write the output of the following python code: 3
class Book:
def __init__(self,N=100,S="Python"): #constructor
self.Bno=N
self.BName=S
def Assign(self, N,S):
self.Bno= self.Bno + N
self.BName= S + self.BName
def ShowVal(self):
print(self.Bno,"#",self.BName)
s=Book()
t=Book(200)
u=Book(300,"Made Easy")
s.ShowVal()
t.ShowVal()
u.ShowVal()
s.Assign(5, "Made ")

Page 20 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

t.Assign(15,"Easy ")
u.Assign(25,"Made Easy")
s.ShowVal()
t.ShowVal()
u.ShowVal()

Ans
Python 2.7 output Other Versions output

100 # Python (100, '#', 'Python')


200 # Python (200, '#', 'Python')
300 # Made Easy (300, '#', 'Made Easy')
105 # Made Python (105, '#', 'Made Python')
215 # Easy Python (215, '#', 'Easy Python')
325 # Made EasyMade Easy (325, '#', 'Made EasyMade Easy')
(½ Mark for each correct line of output)
Note:
●Deduct ​½ Mark for not writing any or all ‘#’ symbol(s)
●Deduct ​½ Mark for not considering any or all line breaks at proper
place(s)
(f) What are the possible outcome(s) executed from the following code? Also specify 2
the maximum and minimum values that can be assigned to variable PICKER.
import random
PICKER=random.randint(0,3)
COLOR=["BLUE","PINK","GREEN","RED"];
for I in COLOR:
for J in range(1,PICKER):
print(I,end="")
print()

(i) (ii) (iii) (iv)


BLUE BLUE PINK BLUEBLUE
PINK BLUEPINK PINKGREEN PINKPINK
GREEN BLUEPINKGREEN GREENRED GREENGREEN
RED BLUEPINKGREENRED REDRED

Ans Option (i) and (iv) are possible

OR

Option (i) only

PICKER maxval=3 minval=0

Page 21 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

(1 Mark for mentioning correct option(s))


Note: No marks to be awarded for writing any other option.

(½ Mark each for Minimum and Maximum Value of PICKER)

2 (a) What is the difference between Multilevel and Multiple inheritance? Give suitable 2
examples to illustrate both.

Ans
Multilevel inheritance Multiple inheritance

X is the parent class of Y and Y is the The child class Z has parents X and Y
parent class of Z

( 1 mark for correct difference)


(1 mark for correct example)
(b) What will be the output of the following python code considering the following set 2
of inputs?
AMAR
THREE
A123
1200

Also, explain the try and except used in the code.


Start=0
while True:
try:
Number=int(raw_input(“Enter Number”))
break
except ValueError:
Start=Start+2

Page 22 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

print(“Re­enter an integer”)
print(Start)

Ans Output:
Enter Number AMAR
Re­enter an integer
Enter Number THREE
Re­enter an integer
Enter Number A123
Re­enter an integer
Enter Number 1200
6

Explanation: The code inside try makes sure that the valid number is entered by
the user. When any input other than an integer is entered, a value error is thrown
and it prompts the user to enter another value.

(½ mark for correct output for text entry)


(½ mark for correct output for number entry)
(1 mark for correct explanation of try and except)
(c) Write a class CITY in Python with following specifications 4
Instance Attributes
­ Ccode # Numeric value
­ CName # String value
­ Pop # Numeric value for Population
­ KM # Numeric value
­ Density # Numeric value for Population Density

Methods:
­ DenCal() # Method to calculate Density as Pop/KM
­ Record() # Method to allow user to enter values
Ccode,CName,Pop,KM and call DenCal() method
­ View() # Method to display all the members
also display a message ”Highly Populated City”
if the Density is more than 10000.

Ans class CITY:


def __init__(self):
self.Ccode = 0
self.CName = “”
self.Pop = 0
self.KM =0

Page 23 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

self.Density=0
def DenCal(self):
self.Density = self.Pop / self.KM
def Record(self):
self.Ccode = input(“Enter CCode”)
self.CName = raw_input(“Enter CName”)
self.Pop = input(“Enter population”)
self.KM = input(“Enter KM”)
DenCal(self) // or self.DenCal()
def View(self):
print CCode,CName,Pop, KM, Density
if self.Density > 10000:
print(“Highly populated city”)
# OR print(“Highly populated city”)

(½ Mark for correct syntax for class header)


(1 Mark for correct declaration of instance attributes)
(½ Mark for correct definition of DenCal() function)
(1 Mark for correct definition of Record() with proper invocation of
DenCal() function)
(1 Mark for correct definition of View())

NOTE:
Deduct ½ Mark if DenCal() is not invoked properly inside Record()
function
(d) How do we implement abstract method in python? Give an example for the same. 2

Ans Abstract method: An unimplemented method is called an abstract method. When


an abstract method is declared in a base class, the derived class has to either
define the method or raise “NotImplementedError”
OR
Abstract Method​can be used to enable parent class method execution.

class Shape(object):
def findArea(self):
pass
class Square(Shape):
def __init__(self,side):
self.side = side
def findArea(self):
return self.side * self.side

Page 24 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

( 1 mark for correct explanation)


( 1 mark for any correct example)

(e) What is the significance of super() method? Give an example for the same. 2

Ans super() function is used to call base class methods which has been extended in
derived class.
EX:

class​​
GradStudent(Student):
def​​
__init__(self):
super(GradStudent,​​
​ self).__init__()
self.subject​​
​ =​​
""
self.working​​
​ =​​
""
def​​
readGrad​​
(self):

# Call readStudent method of parent class
super(GradStudent,​​
​ self).readStudent()

( 1 mark for correct explanation)


( 1 mark for correct example)

3. (a) What will be the status of the following list after the First, Second and Third pass 3
of the selection sort method used for arranging the following elements in
descending order?
Note: Show the status of all the elements after each pass very clearly underlining
the changes.
12, 14, ­54, 64, 90, 24
Ans

( 1 mark for each correct pass)


(b) For a given list of values in descending order, write a method in python to search 2
for a value with the help of Binary Search method. The method should return
position of the value and should return ‐1 if the value not present in the list.

Page 25 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

Ans def binarysrch(nums,x):


high = len(nums)
low =0
while low < high:
mid = (low + high)//2
midval = nums[mid]
if midval > x:
low = mid + 1
elif midval < x:
high = mid
else:
return mid
return ­1
( ½ mark for assignment of high/ub and low/lb)
( ½ mark for appropriate looping condition)
( ½ mark for calculation of Mid)
( ½ mark for changing high/ub and low/lb)
(c) Write Insert(City) and Delete(City) methods in python to add City and Remove City 4
considering them to act as Insert and Delete operations of the data structure
Queue.
Ans class queue:
city = [ ]
def Insert(self):
a = raw_input(“Enter city”)
queue.city.append(a)
def Delete(self):
if (queue.city == [ ] ):
print “Queue empty”
else:
print “Deleted element is”, queue.city[0]
queue.city.delete()

OR

class queue:
city = [ ]
def Insert(self):
a = raw_input(“Enter city”)
queue.a.append(a)
def Delete(self):
if (queue.city == [ ] ):
print(“Queue empty”)
else:

Page 26 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

print(“Deleted element is”, queue.city[0])


queue.city.delete()
( ½ mark insert header)
( ½ mark for accepting a value from user)
( ½ mark for adding value in list)
( ½ mark for delete header)
( ½ mark for checking empty list condition)
( ½ mark for displaying “Empty Message”)
( ½ mark for displaying the value to be deleted)
( ½ mark for deleting value from list)
(d) Write a method in python to find and display the prime numbers between 2 to N. 3
Pass N as argument to the method.
Ans def prime(N):
for a in range(2,N):
Prime=1
for I in range(2,a):
if a%i ==0:
Prime=0
if Prime==1:
print a
OR
def prime(N):
for a in range(2,N):
for I in range(2,a):
if a%i ==0:
break
else:
print a
OR

Any other correct code performing the same

( ½ mark function header)


( ½ mark for outer loop)
( ½ mark for inner loop)
( 1 mark for divisibility check)
( ½ mark for displaying prime number)

(e) Evaluate the following postfix notation of expression. Show status of stack after 2
every operation.
12,2,/,34,20,­,+,5,+

Page 27 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

Ans
Element Stack
12 12
2 12, 2
/ 6
34 6, 34
20 6, 34, 20
­ 6, 14
+ 20
5 20, 5
+ 25

Final Result = 25
(½ Mark for evaluation till each operator)
OR
(1 Mark for only writing the Final answer without showing stack status)
4 (a) Write a statement in Python to perform the following operations: 1
● To open a text file “MYPET.TXT” in write mode
● To open a text file “MYPET.TXT” in read mode
Ans ● f1 = open(“MYPET.TXT”,’w’)
f2 = open(“MYPET.TXT”, ‘r’)

( ½ Mark for each correct statement)


(b) Write a method in python to write multiple line of text contents into a text file 2
daynote.txt line.

Ans ​ef writel():


d
f = open(“daynote.txt”,’w’)
while True:
line = raw_input(“Enter line”)
f.write(line)
choice = raw_input(“Are there more lines”)
if choice == ‘N’:
break
f.close()
Note: Using writelines() is also correct
(½ Mark for opening file in appropriate mode)
(½ Mark for end of file check and loop)
(½ Mark for taking input from user)
(½ Mark for writing the line into the file)

Page 28 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

(c) Consider the following definition of class Employee, write a method in python to 3
search and display the content in a pickled file emp.dat, where Empno is matching
with ‘A0005’.

class Employee:
def __init__(self,E,NM):
self.Empno=E
self.EName=NM

def Display(self):
print(self.Empno," ­ ",self.EName)

Ans def search():


f = open("emp.dat", ‘rb’)
try:
while True:
e = pickle.load(f)
if e.Empno == ‘A0005’:
e.display()
except EOFError:
pass
f.close()

(½ Mark for correct function header)


(½ Mark for opening the file emp.dat correctly)
(½ Mark for correct file check and loop)
(½ Mark for correct load())
(½ Mark for correct checking of Empno)
(½ Mark for displaying the record)

SECTION C ‐ (For all the candidates)


5 (a) Observe the following PARTICIPANTS and EVENTS tables carefully and write the 2
name of the RDBMS operation which will be used to produce the output as shown in
RESULT ? Also, find the Degree and Cardinality of the result.

PARTICIPANTS EVENTS
PNO NAME EVENTCODE EVENTNAME
1 Aruanabha Tariban 1001 IT Quiz
2 John Fedricks 1002 Group Debate
3 Kanti Desai

Page 29 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

RESULT
PNO NAME EVENTCODE EVENTNAME
1 Aruanabha Tariban 1001 IT Quiz
1 Aruanabha Tariban 1002 Group Debate
2 John Fedricks 1001 IT Quiz
2 John Fedricks 1002 Group Debate
3 Kanti Desai 1001 IT Quiz
3 Kanti Desai 1002 Group Debate

Ans Cartesian Product


Degree = 4
Cardinality = 6
(1 Mark for writing the correct name of RDBMS operation)
(½ Mark for writing correct degree)
(½ Mark for writing correct cardinality)
(b) Write SQL queries for (i) to (iv) and find outputs for SQL queries (v) to (viii), which 6
are based on the tables

Table: VEHICLE
VCODE VEHICLETYPE PERKM
V01 VOLVO BUS 150
V02 AC DELUXE BUS 125
V03 ORDINARY BUS 80
V05 SUV 30
V04 CAR 18
Note: PERKM is Freight Charges per kilometer

Table: TRAVEL
CNO CNAME TRAVELDATE KM VCODE NOP
101 K.Niwal 2015­12­13 200 V01 32
103 Fredrick Sym 2016­03­21 120 V03 45
105 Hitesh Jain 2016­04­23 450 V02 42
102 Ravi Anish 2016­01­13 80 V02 40
107 John Malina 2015­02­10 65 V04 2
104 Sahanubhuti 2016­01­28 90 V05 4
106 Ramesh Jaya 2016­04­06 100 V01 25

Note:
● Km is Kilometers travelled
● NOP is number of passengers travelled in vehicle

Page 30 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

(i) To display CNO, CNAME, TRAVELDATE from the table TRAVEL in descending order
of CNO.

Ans SELECT CNO, CNAME, TRAVELDATE FROM TRAVEL ORDER BY CNO


DESC;

​ELECT CNO, CNAME, TRAVELDATE FROM TRAVEL​


(½ Mark for S )
(½ Mark for ​ )
ORDER BY CNO DESC​
(ii) To display the CNAME of all the customers from the table TRAVEL who are
traveling by vehicle with code V01 or V02.
Ans SELECT CNAME FROM TRAVEL WHERE VCODE=‘V01’ OR
VCODE=’V02’;
OR
SELECT CNAME FROM TRAVEL WHERE VCODE IN (‘V01’, ‘V02’);

(½ Mark for correct ​ )


SELECT​
​HERE clause​
(½ Mark for correct W )
(iii) To display the CNO and CNAME of those customers from the table TRAVEL who
travelled between ‘2015‐12‐31’ and ‘2015‐05‐01’.
Ans SELECT CNO, CNAME from TRAVEL WHERE TRAVELDATE >=
‘2015­05­01’ AND TRAVELDATE <= ‘2015­12­31’;
OR
SELECT CNO, CNAME from TRAVEL
WHERE TRAVELDATE BETWEEN ‘2015­05­01’ AND ‘2015­12­31’;
OR
SELECT CNO, CNAME from TRAVEL
WHERE TRAVELDATE <= ‘2015­12­31’
AND TRAVELDATE >= ‘2015­05­01’;
OR
SELECT CNO, CNAME from TRAVEL
WHERE TRAVELDATE BETWEEN ‘2015­12­31’ AND ‘2015­05­01’;

(½ Mark for correct ​ )


SELECT​
​HERE clause ​
(½ Mark for correct W )
(iv) To display all the details from table TRAVEL for the customers, who have travel
distance more than 120 KM in ascending order of NOP.
Ans SELECT * FROM TRAVEL
WHERE KM > 120 ORDER BY NOP;

Page 31 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

(½ Mark for correct ​ )


SELECT​
​HERE clause ​
(½ Mark for correct W )
(v) SELECT COUNT(*),VCODE FROM TRAVEL
GROUP BY VCODE HAVING COUNT(*)>1;

Ans COUNT(*)​ ​ VCODE


2 V01
2 V02
(½ Mark for correct output)
(vi) SELECT DISTINCT VCODE FROM TRAVEL;
Ans DISTINCT VCODE
V01
V02
V03
V04
V05
(½ Mark for correct output)
(vii) SELECT A.VCODE,CNAME,VEHICLETYPE
FROM TRAVEL A,VEHICLE B
WHERE A.VCODE=B.VCODE AND KM<90;

Ans VCODE​ C​ NAME​ ​EHICLETYPE


V
V02 ​
Ravi Anish​ AC DELUXE BUS
V04 John Malina CAR
(½ Mark for correct output)
(viii) SELECT CNAME,KM*PERKM
FROM TRAVEL A,VEHICLE B
WHERE A.VCODE=B.VCODE AND A.VCODE=’V05’;
Ans CNAME​ ​M*PERKM
K
Sahanubhuti 2700

(½ Mark for correct output)


6 a. Verify the following using Boolean Laws. 2
X’+ Y’Z = X’.Y’.Z’+ X’.Y.Z’+ X’Y.Z+ X’.Y’.Z+ X.Y’.Z

Ans LHS
X’ + Y’.Z
= X’.(Y + Y’).(Z + Z’) + (X + X’).Y’.Z

Page 32 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

= X’.Y.Z + X’.Y.Z’ + X’.Y’.Z + X’.Y’.Z’ + X.Y’.Z + X’.Y’.Z


= X’.Y.Z + X’.Y.Z’ + X’.Y’.Z + X’.Y’.Z’ + X.Y’.Z
= X’.Y’.Z’ + X’.Y.Z’ + X’.Y.Z + X’.Y’.Z + X.Y’.Z
=​RHS
OR
RHS
X’.Y’.Z’ + X’.Y.Z’ + X’.Y.Z + X’.Y’.Z + X.Y’.Z
= X’.Y’.Z + X’.Y’.Z’ + X’.Y.Z + X’.Y.Z’ + X.Y’.Z
= X’.Y’.(Z+Z’) + X’.Y.(Z+Z’) + X.Y’.Z
= X’.Y’ + X’.Y + X.Y’.Z
= X’.(Y’+Y) +X.Y’.Z
= X’ + X.Y’.Z
= (X’ + X).(X’ + Y’.Z)
= X’ + Y’.Z
=​LHS

(2 Marks for correct Verification)


OR
(1 Mark for expanding LHS up to 1 correct step)
OR
(1 Mark for reducing RHS up to 1 correct step)
b. Write the Boolean Expression for the result of the Logic Circuit as shown below: 2

Ans P.Q’ + P.R + Q.R’

(2 Marks for correctly writing the full expression )


OR
(½ Mark each for correctly writing any one term)

c. Derive a Canonical SOP expression for a Boolean function G, represented by the 1


following truth table:

A B C G(A,B,C)
0 0 0 1
0 0 1 0

Page 33 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

0 1 0 1
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 1

Ans G(A,B,C) = A’.B’.C’ + A’.B.C’ + A.B.C’ + A.B.C


OR
G(A,B,C) = ​​0,2,6,7)
ᵫ(

(1 Mark for correctly writing the SOP form)

Note: Deduct ½ mark if wrong variable names are written in the


expression
(d) Reduce the following Boolean Expression to its simplest form using K‐Map: 3
F(P,Q,R,S)= Σ (0,4,5,8,9,10,11,12,13,15)

OR

F(P,Q,R,S) = R’S’+ PQ’ + QR’+ PS

Page 34 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

( ½ Mark for drawing K‐Map with correct variable names)


( ½ Mark each for 4 groupings)
( ½ Mark for writing final expression in reduced/minimal form)

Note: Deduct ½ mark if wrong variable names are used


7 (a) Differentiate between PAN and LAN types of networks. 1
Ans
PAN ‐ ​
Personal Area Network LAN ‐ ​
Local Area Network
A personal area network ‐ PAN ‐ is a LAN interconnects a high number of
computer network organized around an access or node points or stations within
individual person. a confined physical area upto a
kilometer.

(1 mark for one correct point of difference)


OR
​ny other correct difference for PAN and LAN)
(1 mark for A
(b) Which protocol helps us to transfer files to and from a remote computer? 1

Ans FTP OR Telnet OR TCP

(1 Mark for any one correct protocol name)


(c) Write two advantages of 3G over 2G Mobile Telecommunication Technologies in 1
terms of speed and services?

Ans Speed ‐
● Faster web browsing
● Faster file transfer
Service ‐
● Better video clarity
● Better security
OR
(Any other correct advantage can be considered)
(½ Mark for each of any one point for Speed/Service)
(d) Write two characteristics of Web 2.0. 1
Ans ● Makes web more interactive through online social medias
● Supports easy online information exchange
● Interoperability on the internet
● Video sharing possible in the websites

Page 35 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

OR
Any two of the above or any other two correct characteristics of Web 2.0
(½ Mark each for any two correct answers)
(e) What is the basic difference between Computer Worm and Trojan Horse? 1
Ans
Trojan Horse Computer Worm

It is a "Malware" computer program It is a self‐replicating computer program


presented as useful or harmless in which uses a network to send copies of
order to induce the user to install itself to other computers on the network
and run them. and it may do so without any user
intervention.

OR
Any other correct difference between Trojan Horse and Computer Worm

(1 Mark for writing correct difference between Trojan Horse and


Computer Worm)
OR
(½ Mark each for writing correct explanation of Trojan Horse /
Computer Worm)

(f) Categories the following under Client side and Server Side script category? 1
(i) Java Script
(ii) ASP
(iii) VB Sript
(iv) JSP

Ans
Client Side Scripts Server Side Scripts
VB Script ASP
Java Script JSP

(1 Mark for correct answer)


OR
(½ Mark for any two correct client/server side script names)
(g) Intelligent Hub India is a knowledge community aimed to uplift the standard of
skills and knowledge in the society. It is planning to setup its training centers in
multiple towns and villages pan India with its head offices in the nearest cities.
They have created a model of their network with a city, a town and 3 villages as

Page 36 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

follows.
As a network consultant, you have to suggest the best network related solutions
for their issues/problems raised in (i) to (iv), keeping in mind the distances
between various locations and other given parameters.

Shortest distances between various locations:


VILLAGE 1 to YTOWN 2 KM
VILLAGE 2 to YTOWN 1.5 KM
VILLAGE 3 to YTOWN 3 KM
VILLAGE 1 to VILLAGE 2 3.5 KM
VILLAGE 1 to VILLAGE 3 4.5 KM
VILLAGE 2 to VILLAGE 3 3.5 KM
CITY Head Office to YHUB 30 Km

Number of Computers installed at various locations are as follows:


YTOWN 100
VILLAGE 1 10
VILLAGE 2 15
VILLAGE 3 15
CITY OFFICE 5

Note:
In Villages, there are community centers, in which one room has been given as
training center to this organization to install computers.

The organization has got financial support from the government and top IT
companies.

(i) Suggest the most appropriate location of the SERVER in the YHUB (out of the 4 1
locations), to get the best and effective connectivity. Justify your answer.
Ans YTOWN

Page 37 of 38
CBSE AISSCE 2015‐2016 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

Justification
● Since it has the maximum number of computers.
● It is closest to all other locations.
(½ Mark for correct answer)
(½ Mark for any one correct justification)
(ii) Suggest the best wired medium and draw the cable layout (location to location) to 1
efficiently connect various locations within the YHUB.
Ans Optical Fiber

(½ Mark for correct wired medium)


(½ mark for correct topology)
(iii) Which hardware device will you suggest to connect all the computers within each 1
location of YHUB?

Ans Switch OR Hub


(1 Mark for correct answer)
(iv) Which service/protocol will be most helpful to conduct live interactions of Experts 1
from Head Office and people at YHUB locations?

Ans Videoconferencing OR VoIP OR any other correct service/protocol


(1 Mark for writing any one of the above answers)

Page 38 of 38
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

General Instructions:
● The answers given in the marking scheme are SUGGESTIVE, Examiners are
requested to award marks for all alternative correct solutions/answers
conveying similar meaning.
● All programming questions have to be answered with respect to C++
Language for Section A and Python for Section B (All presently supported
versions of compilers/interpreters should be considered).
● In C++/Python, ignore case sensitivity for identifiers (Variable / Functions
/ Structures / Class Names) ​
unless explicitly specified in question​
.
● In SQL related questions :
○ Both ways of text/character entries should be acceptable. For
example: “AMAR” and ‘amar’ both are acceptable.
○ All date entries should be acceptable for example: ‘YYYY‐MM‐DD’,
‘YY‐MM‐DD’, ‘DD‐Mon‐YY’, “DD/MM/YY”, ‘DD/MM/YY’, “MM/DD/YY”,
‘MM/DD/YY’ and {MM/DD/YY} are correct.
○ Semicolon should be ignored for terminating the SQL statements.
○ Ignore case sensitivity for commands.
○ Ignore headers in output questions.

Section ‐ A
(Only for C++ candidates)
1 (a) Find the correct identifiers out of the following, which can be 2
used for naming Variable, Constants or Functions in a C++
program:
For, while, INT, NeW, delete, 1stName, Add+Subtract, name1

Ans For, INT, NeW, name1

( ½ Mark for each correct identifier)


Note:
● Deduct ½ Mark for writing additional incorrect
identifier(s)
● No marks to be awarded if all the identifiers are
mentioned

(b) Observe the following program very carefully and write the name 1
of those header file (s), which are essentially needed to compile
and execute the following program successfully:

typedef char STRING[80];


void main()
{
STRING Txt[] = "We love Peace";
int Count=0;
while (Txt[Count]!='\0')

Page 1 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

if (isalpha(Txt[Count]))
Txt[Count++]='@' ;
else
Txt[Count++]='#' ;
puts (Txt) ;
}

Ans ctype, stdio

( ½ mark for each header file)


Note: Ignore any additional header file(s)

(c) Observe the following C++ code very carefully and rewrite it 2
after removing any/all syntactical errors with each correction
underlined.
Note: Assume all required header files are already being included
in the program.

#Define float MaxSpeed=60.5;


void main()
{
int MySpeed
char Alert='N' ;
cin»MySpeed;
if MySpeed>MaxSpeed
Alert='Y' ;
cout<<Alert<<endline;
}

Ans #define​​
float​MaxSpeed​​ ;​ //Error 1,2,3
60.5​
void main()
{
int MySpeed ​;​ //Error 4
char Alert='N';
cin>>MySpeed;
if ​
(MySpeed>MaxSpeed) ​ //Error 5
Alert=’Y’;
cout<<Alert<<​endl;​ //Error 6
}

(½ Mark for each correction upto a maximum of 4 corrections)


OR
(1 mark for only identifying any 4 errors, without suggesting
corrections)

(d) Write the output of the following C++ program code: 2


Note: Assume all required header files are already being
included in the program.

Page 2 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

void Location(int &X,int Y=4)


{
Y+=2;
X+=Y;
}
void main()
{
int PX=l0,PY=2;
Location(PY) ;
cout<<PX<<" , "<<PY<<endl ;
Location(PX,PY);
cout<<PX<<" , "<<PY<<endl ;
}

Ans 10, 8
20, 8

(½ Mark for each correct value )


Note:
● Deduct ​½ Mark for not considering any or all endl(s) at
proper place(s)
● Deduct ​½ Mark for not considering any or all ‘,’ at proper
place(s)

(e) Write the output of the following C++ program code: 3


Note: Assume all required header files are already being included
in the program.
class Eval
{
char Level;
int Point;
public:
Eval() {Level='E';Point=0;}
void Sink(int L)
{
Level­=L;
}
void Float(int L)
{
Level += L;
Point++;
}
void Show()
{
cout<<Level<<"#"<<Point<<endl;
}

Page 3 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

void main()
{
Eval E;
E.Sink(3);
E.Show();
E.Float(7);
E.Show();
E.Sink(2);
E.Show();
}

Ans B#0
I#1
G#1
(1 Mark for each correct line of output)
Note:
● Deduct ​½ Mark for not considering any or all endl(s) at
proper place(s)
● Deduct ​½ Mark for not writing any or all # symbol(s)

(f) Study the following program and select the possible output(s) 2
from the option (i) to (iv) following it. Also, write the maximum
and the minimum values that can be assigned to the variable
VAL.
Note:
‐Assume all required header files are already being included in
the program.
‐random(n) function generates an integer between 0 and n‐1.
void main()
{
randomize();
int VAL;
VAL=random(3)+2;
char GUESS[]="ABCDEFGHIJK";
for (int I=l;I<=VAL;I++)
{
for(int J=VAL;J<=7;J++)
cout«GUESS[J];
cout«endl;
}
}

(i) (ii) (iii) (iv)


BCDEFGH CDEFGH EFGH FGHI
BCDEFGH CDEFGH EFGH FGHI
EFGH FGHI
EFGH FGHI

Page 4 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

Ans (ii) and (iii)


Min Value of VAL = 2
Max Value of VAL = 4

(½ Mark for writing option (ii) )


(½ Mark for writing option (iii) )
Note:
● Deduct ½ mark for writing each ​
additional​
option along
with both correct options

(½ Mark for writing correct Minimum value of VAL)


(½ Mark for writing correct Maximum value of VAL)

2. (a) What is a copy constructor? Give a suitable example in C++ to 2


illustrate with its definition within a class and a declaration of an
object with the help of it.

Ans A copy constructor is an overloaded constructor in which an


object of the same class is passed as reference parameter.
class Point
{
int x;
public:
Point(){x=0;}
Point(Point &p) // Copy constructor
{x = p.x;}
:

void main()
{
Point p1;
Point p2(p1);//Copy constructor is called here
//OR
Point p3=p1;//Copy constructor is called here
}

(1½ Mark to be awarded if the copy constructor is explained


with an appropriate example)
OR
(​
1 Mark for correct explanation of copy constructor only without
an example)

(½ Mark for correct declaration of an object)

Page 5 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

(b) Observe the following C++ code and answer the questions (i) and
(ii) :
class Passenger
{
long PNR;
char Name [20] ;
public:
Passenger() //Function 1
{ cout<<"Ready"<<endl; }

void Book(long P,char N[]) //Function 2


{ PNR = P; strcpy(Name, N); }

void Print() //Function 3


{ cout«PNR << Name <<endl; }

~Passenger() //Function 4
{ cout<<"Booking cancelled!"<<endl; }

(i) Fill in the blank statements in Line 1 and Line 2 to execute 1


Function 2 and Function 3 respectively in the following code:
v​
oid main()
{
​ Passenger P;
___________ //Line 1
___________ //Line 2
}//Ends here

Ans P.Book(1234567,”Ravi”); //Line 1


P.Print(); //Line 2

(½ Mark for writing each correct Function )

(ii) Which function will be executed at }//Ends here? What is this 1


function referred as ?

Ans Function 4
OR
~Passenger()
It is a Destructor function.

( ½ Mark for writing Function 4 OR ~Passenger())


( ½ Mark for referring Destructor)

Page 6 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

(C) Write the definition of a class Photo in C++ with following 4


description:
Private Members
­Pno //Data member for Photo Number
(an integer)
­Category //Data member for Photo Category
(a string)
­Exhibit //Data member for Exhibition Gallery
(a string)
­FixExhibit//A member function to assign
//Exhibition Gallery as per Category
//as shown in the following table
Category Exhibit
Antique Zaveri
Modern Johnsen
Classic Terenida
Public Members
­Register()//A function to allow user to enter
//values
//Pno,Category and call FixExhibit()
//function
­ViewAll()//A function to display all the data
//members

Ans class Photo


{
int Pno;
char Category[20];
char Exhibit[20];
void FixExhibit();
public:
void Register();
void ViewAll();

void Photo::FixExhibit()
{
if(strcmpi(Category,”Antique”)==0)
strcpy(Exhibit,”Zaveri”);
else if(strcmpi(Category,”Modern”)==0)
strcpy(Exhibit,”Johnsen”);
else if strcmpi(Category,”Classic”)==0)
strcpy(Exhibit,”Terenida”);
}
void Photo::Register()
{
cin>>Pno;
gets(Category);

Page 7 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)


FixExhibit();
}
void Photo:: ViewAll()
{
cout<<Pno<<Category<<Exhibit<<endl;
}

(½ Mark for correct syntax for class header)


(½ Mark for correct declaration of data members)
(1 Mark for correct definition of FixExhibit())
(1 Mark for correct definition of Register() with proper
invocation of FixExhibit() function)
(1 Mark for correct definition of ViewAll())
NOTE:
● Deduct ½ Mark if FixExhibit() is not invoked properly
inside Register() function
● No marks to be deducted for defining Member Functions
inside the class
● strcmp()/strcmpi() acceptable

(d) Answer the questions (i) to (iv) based on the following: 4


class Interior
{
int OrderId;
char Address[20];
protected:
float Advance;
public:
Interior();
void Book(); void View();

class Painting:public Interior
{
int WallArea,ColorCode;
protected:
char Type;
public:
Painting();
void PBook();
void PView();

class Billing:public Painting


{
float Charges;
void Calculate();

Page 8 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

public:
Billing();
void Bill();
void BillPrint();

(i) Which type of Inheritance out of the following is illustrated


in the above example?
‐Single Level Inheritance
‐Multi Level Inheritance
‐Multiple Inheritance

Ans Multi Level Inheritance


(1 Mark for mentioning correct option)

(ii) Write the names of all the data members, which are directly
accessible from the member functions of class Painting.

Ans WallArea, ColorCode,Type, Advance

(1 Mark for correct answer)


Note:
● No marks to be awarded for any partial or additional
answer(s)

(iii) Write the names of all the member functions, which


are directly accessible from an object of class Billing.

Ans Bill(), BillPrint(), PBook(), PView(), Book(), View()

(1 Mark for correct answer)


Note: No marks to be awarded for any partial/additional
answer(s)
● Constructors can be ignored

(iv) What will be the order of execution of the constructors,


when an object of class Billing is declared?

Ans Interior, Painting, Billing

(1 Mark for correct answer)


Note: No marks to be awarded for any other order

3 (a) Write the definition of a function Change(int P[], int N) in C++, 2


which should change all the multiples of 10 in the array to 10
and rest of the elements as 1. For example, if an array of 10
integers is as follows:

Page 9 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

P[0] P[1] P[2] P[3] P[4] P[5] P[6] P[7] P[8] P[9]

100 43 20 56 32 91 80 40 45 21
After executing the function, the array content should be
changed as follows:
P[0] P[1] P[2] P[3] P[4] P[5] P[6] P[7] P[8] P[9]

10 1 10 1 1 1 10 10 1 1

Ans void Change(int P[ ],int N)


{
for (int i=0;i<N;i++)
if(P[i]%10==0)
P[i]=10;
else
P[i]=1;
}

OR
Any other correct equivalent function definition

( ½ Mark for correct loop)


( ½ Mark for correct checking of divisibility of array elements
by 10)
( ½ Mark for correct use of else OR correct checking of non
divisibility of array elements by 10 )
( ½ Mark for correct assignment of 10 and 1 for multiples and
non multiples of 10 respectively)

(b) A two dimensional array ARR[50][20] is stored in the memory 3


along the row with each of its elements occupying 4 bytes. Find
the address of the element ARR[30][10], if the element
ARR[10] [5] is stored at the memory location 15000.

Ans Loc(ARR[I][J]) along the row


=BaseAddress + W [( I – LBR)*C + (J – LBC)]
(where C is the number of columns, LBR = LBC = 0
LOC(ARR[10][5])
= BaseAddress + W [ I*C + J]
15000 = BaseAddress + 4[10*20 + 5]
= BaseAddress + 4[200 + 5]
= BaseAddress + 4 x 205
= BaseAddress + 820
BaseAddress = 15000­820
= 14180
LOC(ARR[30][10])= 14180 + 4[30 * 20 + 10]
= 14180 + 4 * 610

Page 10 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

= 14180 + 2440
= 16620
OR
LOC(ARR[30][10])
= LOC(ARR[10][5])+ W[( I­LBR)*C + (J­LBC)]
= 15000 + 4[(30­10)*20 + (10­5)]
= 15000 + 4[ 20*20 + 5]
= 15000 + 4 *405
= 15000 + 1620
= 16620
OR
Where C is the number of columns and LBR=LBC=1
LOC(ARR[10][5])
15000 = BaseAddress + W [( I­1)*C + (J­1)]
= BaseAddress + 4[9*20 + 4]
= BaseAddress + 4[180 + 4]
= BaseAddress + 4 * 184
= BaseAddress + 736
BaseAddress = 15000 ­ 736
= 14264
LOC(ARR[30][10])
= 14264 + 4[(30­1)*20 + (10­1)]
= 14264 + 4[29*20 + 9]
= 14264 + 4[580 + 9]
= 14264 + 4*589
= 14264 + 2356
= 16620

(1 Mark for writing correct formula (for row major) OR


substituting formula with correct values)
( 1 Mark for at least one step of intermediate calculation)
( 1 Mark for final correct address)

(c) Write the definition of a member function PUSH() in C++, to add a 4


new book in a dynamic stack of BOOKS considering the following
code is already included in the program:
struct BOOKS
{
char ISBN[20], TITLE[80];
BOOKS *Link;

class STACK
{
BOOKS *Top;
public:
STACK()
{Top=NULL;}
void PUSH();

Page 11 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

void POP();
~STACK();

Ans void STACK::PUSH()


{
BOOKS *Temp;
Temp=new BOOKS;
gets(Temp­>ISBN);
gets(Temp­>TITLE);
Temp­>Link=Top;
Top=Temp;
}
OR
Any other correct equivalent function definition
(1 Mark for creating a new node of BOOKS dynamically)
( ½ Mark for entering value of ISBN)
( ½ Mark for entering value of TITLE)
(1 Mark for linking the new node of BOOKS to the Top )
(1 Mark for making the new node of BOOKS as Top)
(d) Write a function REVROW(int P[][5],int N, int M) in C++ to 3
display the content of a two dimensional array, with each row
content in reverse order.
For example, if the content of array is as follows:
15 12 56 45 51
13 91 92 87 63
11 23 61 46 81
The function should display output as:
51 45 56 12 15
63 87 92 91 13
81 46 61 23 81

Ans ​oid REVROW(int P[][5],int N,int M)


v
{
for(int I=0; I<N; I++)
{ for(int J=M­1; J>=0; J­­)
cout<<P[I][J];
cout<<endl;
}
}
OR

void REVROW(int P[ ][5],int N,int M)
{
for(int I=0; I<N; I++)
{
for(int J=0; J<M/2; J++)
{

Page 12 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

int T = P[I][J];
P[I][J] = P[I][M­J­1];
P[I][M­J­1] = T;
}
}
for(I=0; I<N; I++)
{
for(int J=0; J<M; J++)
cout<<P[I][J];
cout<<endl;
}
}

( 1 Mark for correct nesting of loop(s))


( 1½ Mark for correct logic for reversing the content of each
row)
( ½ Mark for correctly displaying the content)
Note: N and M can be written interchangeably for number of
rows and columns

(e) Convert the following infix expression to its equivalent Postfix 2


expression, showing the stack contents for each step of
conversion.
U * V + R/ (S­T)

Ans U * V + R/ (S­T)
= ((U * V)+(R/(S­T)))
Element Stack Postfix
(
(
U U
* *
V UV
) UV*
+ +
(
R UV*R
/ +/
(
S UV*RS
­ +/­
T UV*RST
) UV*RST­
) UV*RST­/
) UV*RST­/+

Page 13 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

OR
Element Stack Postfix
U U
* * U
V * UV
+ + UV*
R + UV*R
/ +/ UV*R
( +/( UV*R
S +/( UV*RS
­ +/(­ UV*RS
T +/(­ UV*RST
) +/ UV*RST­
+ UV*RST­/
UV*RST­/+
OR
Any other method for converting the given Infix expression to its
equivalent Postfix expression showing stack contents

( ½ mark for converting expression up to each operator)


OR
(1 mark to be given for writing correct answer without showing
the stack content)

4 (a) Write function definition for TOWER() in C++ to read the content
of a text file WRITEUP.TXT, count the presence of word TOWER
and display the number of occurrences of this word. 2
Note :
‐ The word TOWER should be an independent word
‐ Ignore type cases (i.e. lower/upper case)
Example:
If the content of the file WRITEUP.TXT is as follows:

Tower of hanoi is an interesting problem.


Mobile phone tower is away from here. Views
from EIFFEL TOWER are amazing.

The function TOWER () should display the following:


3

Ans void TOWER()


{
int count=0;
ifstream f("WRITEUP.TXT");
char s[20];

Page 14 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

while (!f.eof())
{
f>>s;
if (strcmpi(s,”TOWER”)==0)
count++;
}
cout<<count;
f.close();
}
OR
Any other correct function definition

(½ Mark for opening WRITEUP.TXT correctly)


(½ Mark for reading each word (using any method) from the
file)
(½ Mark for comparing the word with TOWER)
(½ Mark for displaying correct count of TOWER)

NOTE:
(½ Mark to be deducted if TOWER is compared without ignoring
the case)

(b) Write a definition for function COSTLY() in C++ to read each 3


record of a binary file GIFTS.DAT, find and display those items,
which are priced more that 2000. Assume that the file GIFTS.DAT
is created with the help of objects of class GIFTS, which is
defined below:

class GIFTS
{
int CODE;char ITEM[20]; float PRICE;
public:
void Procure()
{
cin>>CODE; gets(ITEM);cin>>PRICE;
}
void View()
{
cout<<CODE<<":"<<ITEM<<":"<<PRICE<<endl;
}
float GetPrice() {return PRICE;}

Ans void COSTLY()


{
GIFTS G;
ifstream fin(“GIFTS.DAT”,ios::binary);
while (fin.read((char *)&G,sizeof(G)))

Page 15 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

{
if(G.GetPrice()>2000)
G.View();
}
fin.close();
}
OR
Any other correct equivalent function definition


​ Mark for opening GIFTS.DAT correctly)
(1 Mark for reading all records from the file)
(1 Mark for checking value of PRICE > 2000 )
(½ Mark for displaying the desired items)

(c) Find the output of the following C++ code considering that the
binary file MEMBER.DAT exists on the hard disk with records of
100 members: 1
class MEMBER
{
int Mno; char Name[20];
public:
void In();void Out();

void main()
{
fstream MF;
MF.open("MEMBER.DAT”,ios::binary|ios::in);
MEMBER M;
MF.read((char*)&M,sizeof(M));
MF.read((char*)&M,sizeof(M));
MF.read((char*)&M,sizeof(M));
int POSITION=MF.tellg()/sizeof(M);
cout<<"PRESENT RECORD:"<<POSITION<<endl;
MF.close();
}

Ans PRESENT RECORD: 3

(1 Mark for writing ​


PRESENT RECORD: 3​
)
OR
(1 Mark for writing only ​
3​
)
OR
(½ Mark for writing only ​
PRESENT RECORD:​
)

Page 16 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

Section ‐ B
(Only for Python candidates)
1 (a) How is __init( ) __different from __del ( )__ ? 2

Ans __init__()​​ is the class constructor or initialization method


which is automatically invoked when we create a new instance of a
class.
__del__() is a destructor which is automatically invoked when
an object (instance) goes out of scope.

For Example:
class Sample:
def __init__(self):
self.data = 79
print('Data:',self.data,'created')

def __del__(self):
print('Data:',self.data,'deleted')
s = Sample()
del s

(2 Marks for correct differentiation )


OR
(2 Marks for differentiation through example​
)
OR
(1 Mark for each correct definition)

(b) Name the function/method required to 1


(i) check if a string contains only alphabets
(ii) give the total length of the list.

Ans isalpha()
len()

(½ Mark for each correct function/ method name)

(c) Rewrite the following code in python after removing all syntax
error(s). Underline each correction done in the code. 2

def Sum(Count) #Method to find sum


S=0
for I in Range(1,Count+1):
S+=I
RETURN S

print Sum[2] #Function Call

Page 17 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

print Sum[5]

Ans :​#Method to find sum


def Sum(Count)​ #Error 1
S=0
for I in ​
range​(1,Count+1): #Error 2
S+=I

return​S #Error 3

print Sum​
(2)​#Function Call #Error 4
print Sum​
(5)​ #Error 4

(½ Mark for each correction)


OR
(1 mark for identifying all the errors, without suggesting
corrections)

(d) Find and write the output of the following python code : 2
for Name in ['John','Garima','Seema','Karan']:
print Name
if Name[0]== 'S':
break
else :
print 'Completed!'
print 'Weldone!'
Ans John
Garima
Seema
Weldone!
(½ Mark for each correct line)

Note:
Deduct ​½ Mark for not considering any or all line breaks at
proper place(s)
(e) Find and write the output of the following python code: 3

class Emp:
def __init__(self,code,nm): #constructor
self.Code=code
self.Name=nm
def Manip (self) :
self.Code=self.Code+10
self.Name='Karan'
def Show(self,line):
print self.Code,self.Name,line
s=Emp(25,'Mamta')

Page 18 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

s.Show(1)
s.Manip()
s.Show(2)
print s.Code+len(s.Name)

Ans 25 Mamta 1
35 Karan 2
40
(1 Mark for each correct line)

Note:
Deduct ​½ Mark for not considering any or all line break(s) at
proper place(s).
(f) What are the possible outcome(s) executed from the following 2
code? Also specify the maximum and minimum values that can be
assigned to variable COUNT.

TEXT="CBSEONLINE"
COUNT=random.randint(0,3)
C=9
while TEXT[C]!='L':
print TEXT[C]+TEXT[COUNT]+'*',
COUNT=COUNT+1
C=C­1
(i) (ii) (iii) (iv)
EC*NB*IS* NS*IE*LO* ES*NE*IO* LE*NO*ON*
Ans (i) EC*NB*IS*
(iii) ES*NE*IO*
Minimum COUNT = 0 Maximum COUNT = 3

(½ Mark for writing option (i) )


(½ Mark for writing option (iii) )
Note:
● Deduct ½ mark for writing each ​
additional​
option along
with both correct options

(½ Mark for writing correct Minimum value of COUNT)


(½ Mark for writing correct Maximum value of COUNT)

2 (a) Illustrate the concept inheritance with the help of a python code 2

Ans class Base:


def __init__ (self):
print "Base Constructor at work..."
def show(self):
print "Hello Base"

Page 19 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

class Der(Base):
def __init__(self):
print "Derived Constructor at work..."

def display(self):
print "Hello from Derived"

(1 Mark for base class)


(1 Mark for derived class)

(b) What will be the output of the following python code ? Explain 2
the try and except used in the code.
A=0
B=6
print 'One'
try:
print 'Two'
X=B/A
Print 'Three'
except ZeroDivisionError:
print B*2
print 'Four'
except:
print B*3
print 'Five'

ANS One
Two
12
Four

The code written within try triggers the exception written after
except ZeroDivisionError: in case there is a division by zero error
otherwise the default exception is executed
OR
Any other correct explanation for usage of try and except

(½ Mark for first two lines of correct output)


(½ Mark for next two lines of correct output)
(½ Mark each for correct explanation of try and except)

(c) Write a class PHOTO in Python with following specifications: 4


Instance Attributes
­ Pno # Numeric value
­ Category # String value
­ Exhibit # Exhibition Gallery with String
value
Methods:
­ FixExhibit() # A method to assign Exhibition

Page 20 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

# Gallery as per Category as


# shown in the following table
Category Exhibit
Antique Zaveri
Modern Johnsen
Classic Terenida
Register() # A function to allow user
# to enter values of Pno, Category
# and call FixExhibit() method

ViewAll{) # A function to display all the data


# members

Ans class PHOTO:


Pno=0
Category=" "
Exhibit=" "
def FixExhibit():
if self.Category=="Antique":
self.Exhibit="Zaveri"
elif self.Category=="Modern":
self.Exhibit="Johnsen"
elif self.Category=="Classic":
self.Exhibit="Terenida"
def Register():
self.Pno=int(input("Enter Pno:"))
self.Category=input("Enter Name:")
self.FixExhibit()
def ViewAll()
print self.Pno,self.Category,self.Exhibit

(½ Mark for correct syntax for class header)


(½ Mark for correct declaration of instance attributes)
(1 Mark for correct definition of FixExhibit())
(1 Mark for correct definition of Register() with proper
invocation of FixExhibit() method)
(1 Mark for correct definition of ViewAll())
NOTE:
Deduct ½ Mark if FixExhibit() is not invoked properly inside
Register() method

(d) What is operator overloading with methods? Illustrate with the 2


help of an example using a python code.

Ans Operator overloading is an ability to use an operator in more


than one form.
Examples:

Page 21 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

In the following example operator + is used for finding the sum of


two integers:
a = 7
b = 5
print(a+b) # gives the output: 12

Whereas in the next example, shown below the same + operator


is used to add two strings:
a = 'Indian '
b = 'Government'
print(a+b) # gives the output: Indian
Government

(1 Mark for correct definition of Operator overloading)


(1 Mark for correct example of Python code to illustrate
Operator overloading)

(e) Write a method in python to display the elements of list twice, if


it is a number and display the element terminated with ‘*’ if it is
not a number. 2
For example, if the content of list is as follows​
:
MyList=['RAMAN',’21’,'YOGRAJ', '3', 'TARA']
The output should be
RAMAN*
2121
YOGRAJ*
33
TARA*

Ans def fun(L):


for I in L:
if I.isnumeric():
print(2*I) # equivalently: print(I+I)
else:
print(I+'*')

(½ Mark for correct loop)


(½ Mark for checking numeric/non numeric)
(½ Mark for displaying numeric content)
(½ Mark for displaying numeric content)

3 (a) What will be the status of the following list after fourth pass of 3
bubble sort and fourth pass of selection sort used for arranging
the following elements in descending order ?
34,­6,12,­3,45,25

Ans Bubble Sort


34,­6,12,­3,45,25 (Original Content)

Page 22 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

i. 34,12,­3,45,25,­6
ii. 34,12,45,25,­3,­6
iii. 34,45,25,12,­3,­6
iv. 45,34,25,12,­3,­6
Selection Sort
34,­6,12,­3,45,25 (Original Content)
i. 45,­6,12,­3,34,25
ii. 45,34,12,­3,­6,25
iii. 45,34,25,­3,­6,12
iv. 45,34,25,12,­6,­3 ​(Unsorted status
after 4th pass)

For Bubble Sort


(1 ½ Mark if (iv) pass is correct)
OR
(½ Mark for (i) pass)
(½ Mark for (ii) pass)
(½ Mark for (iii) pass)

For Selection Sort


(1 ½ Mark if (iv) pass is correct)
OR
(½ Mark for (i) pass)
(½ Mark for (ii) pass)
(½ Mark for (iii) pass)

(b) Write a method in python to search for a value in a given list


(assuming that the elements in list are in ascending order) with
the help of Binary Search method. The method should return ‐1,
if the value not present else it should return position of the
value present in the list. 2

Ans def bSearch(L, key):


low = 0
high = len(L)­1
found = False
while (low <= high) and (not found):
mid = (low+high)//2
if L[mid] == key:
found = True
elif L[mid] < key:
low = mid + 1
else:
high = mid ­ 1
if found:
return mid+1 # may even be 'return mid'
else:
return ­1

Page 23 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

(½ Mark for correct Initialization of lower and upper bounds)


(½ Mark for correct loop)
(½ Mark for reassigning Mid,Low,Up bound)
(½ Mark for returning correct value)

(c) Write PUSH (Names) and POP (Names) methods in python to add
Names and Remove names considering them to act as Push and
Pop operations of Stack. 4

Ans def push(Name):


Stack.append(Name)
print ‘Element:',Name,'inserted successfully'

def pop():
if Stack == []:
print('Stack is empty!')
else:
print('Deleted element is',Stack.pop())

(2 Marks for correctly pushing an element into the stack)


(1 Mark for checking empty stack in POP())
(1 Mark for popping element from stack)

(d) Write a method in python to find and display the composite


numbers between 2 to N. Pass N as argument to the method. 3

Ans def composite_numbers(N):


for I in range(2, N+1):
M = I // 2
for J in range(2, M+1):
if I % J == 0:
print(I)
break
OR
Any other correct equivalent method definition

(1 Mark for correct loops)


(1 Mark for checking composite numbers between 2 to N)
(1 Mark for displaying the numbers)

(e) Evaluate the following postfix notation of expression. Show


status of stack after every operation.
2
34,23,+,4,5,*,­

Ans
Element Stack
34 34
23 34, 23

Page 24 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

+ 57
4 57, 4
5 57, 4, 5
* 57, 20
­ 37

(1 mark for evaluating till 57)


( ½ mark for evaluating till 57,20)
( ½ mark for evaluating till final 37)
Note:
Only 1 mark to be awarded for evaluating final answer as 37
without showing stack contents
4 (a) Differentiate between the following: 1

(i) f = open ('diary. txt', 'a')
(ii) f = open ('diary. txt', 'w')

Ans (i) diary.txt is opened for writing data at the end of file
(ii) diary.txt is opened for writing data from the beginning of file
in create mode

( 1 mark for writing correct difference)


OR
(½ Mark for each correct explanation of (i) and (ii))

(b) Write a method in python to read the content from a text file
story.txt line by line and display the same on screen. 2

Ans def read_file():


inFile = open('story.txt', 'r')
for line in inFile:
print line

(½ Mark for opening the file)


(1 Mark for reading all lines)
(½ Mark for displaying all lines)

(c) Consider the following definition of class Student. Write a


method in python to write the content in a pickled file
student.dat 3
class Student:
def_init_(self,A,N} :
self.Admno=A
self.Name=N
def Show(self}:
print (self.Admno, "#" , self.Name}

Page 25 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

Ans import pickle


class Student:
def __init__(self, A, N):
self.Admno = A
self.Name = N

def show(self):
print(self.Admno,"#",self.Name)

def store_data(self):
piFile = open('student.dat','wb')
pickle.dump(self, piFile)
piFile.close()

(1 Mark for method header)


(1 Mark for opening the file student.dat in correct mode)
(1 Mark each for writing student details into the file)

Section ‐ C
(For all candidates)
5 (a) Observe the following table carefully and write the names of the
most appropriate columns, which can be considered as
(i) candidate keys and (ii) primary key. 2

Code Item Qty Price Transaction


Date
1001 Plastic Folder 14” 100 3400 2014‐12‐14
1004 Pen Stand Standard 200 4500 2015‐01‐31
1005 Stapler Mini 250 1200 2015‐02‐28
1009 Punching Machine Small 200 1400 2015‐03‐12
1003 Stapler Big 100 1500 2015‐02‐02

Ans Candidate keys : Code, Item


Primary keys : Code

(1 Mark for writing correct Candidate keys)


(1 Mark for writing correct Primary key)
Note:
No marks to be deducted for mentioning Price and/or
Transaction Date as additional candidate keys.

(b) Consider the following DEPT and EMPLOYEE tables. Write SQL 6
queries for ​ to ​
( i)​ and find outputs for SQL queries ​
( iv)​ to ​
( v)​ ( viii).

Table: DEPT

Page 26 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

DCODE DEPARTMENT LOCATION


D01 INFRASTRUCTURE DELHI
D02 MARKETING DELHI
D03 MEDIA MUMBAI
D05 FINANCE KOLKATA
D04 HUMAN RESOURCE MUMBAI

Table: EMPLOYEE
ENO NAME DOJ DOB GENDER DCODE
1001 George K 2013­09­02 1991­09­01 MALE D01
1002 Ryma Sen 2012­12­11 1990­12­15 FEMALE D03
1003 Mohitesh 2013­02­03 1987­09­04 MALE D05
1007 Anil Jha 2014­01­17 1984­10­19 MALE D04
1004 Manila Sahai 2012­12­09 1986­11­14 FEMALE D01
1005 R SAHAY 2013­11­18 1987­03­31 MALE D02
1006 Jaya Priya 2014­06­09 1985­06­23 FEMALE D05
Note: DOJ refers to date of joining and DOB refers to date of
Birth of employees.

(i) To display Eno, Name, Gender from the table EMPLOYEE in


ascending order of Eno.

Ans SELECT​​
Eno,Name,Gender FROM Employee
ORDER BY Eno;
(½ Mark for ​ )
SELECT Eno,Name,Gender FROM Employee​
(½ Mark for ​ )
ORDER BY Eno​

(ii) To display the Name of all the MALE employees from the table
EMPLOYEE.

Ans SELECT Name FROM Employee WHERE Gender=’MALE’;


(½ Mark for ​ )
SELECT Name FROM Employee​
(½ Mark for ​ )
WHERE Gender=’MALE’​

(iii) To display the Eno and Name of those employees from the
table EMPLOYEE ​ who are born between '1987‐01‐01' and
'1991‐12‐01'.

Ans SELECT Eno,Name FROM Employee


WHERE DOB BETWEEN ‘1987­01­01’ AND ‘1991­12­01’
OR
SELECT Eno,Name FROM Employee
WHERE DOB >=‘1987­01­01’ AND DOB <=‘1991­12­01’;
OR
SELECT Eno,Name FROM Employee
WHERE DOB >‘1987­01­01’ AND DOB <‘1991­12­01’;

(½ Mark for ​ )
SELECT Eno,Name FROM Employee​
(½ Mark for

Page 27 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

WHERE DOB BETWEEN ‘1987­01­01’ AND ‘1991­12­01’


OR ​
WHERE DOB >=‘1987­01­01’ AND DOB <=‘1991­12­01’
OR ​
WHERE DOB >‘1987­01­01’ AND DOB <‘1991­12­01’ )

(iv) To count and display FEMALE employees who have joined


after '1986‐01‐01'.

Ans SELECT count(*) FROM Employee


WHERE GENDER=’FEMALE’ AND DOJ > ‘1986­01­01’;
OR
SELECT * FROM Employee
WHERE GENDER=’FEMALE’ AND DOJ > ‘1986­01­01’;

(Any valid query for counting and/or displaying for female


employees will be awarded 1 mark)

(v) ​
SELECT COUNT(*),DCODE FROM EMPLOYEE
GROUP BY DCODE HAVING COUNT(*)>1;

Ans COUNT​ ​CODE


D

2 D01
2 D05
(½ Mark for correct output)

(vi) ​
SELECT DISTINCT DEPARTMENT FROM DEPT;

Ans Department
INFRASTRUCTURE
MARKETING
MEDIA
FINANCE
HUMAN RESOURCE

(½ Mark for correct output)

(vii) SELECT NAME, DEPARTMENT FROM EMPLOYEE E, DEPT


D WHERE E.DCODE=D.DCODE AND EN0<1003;

Ans NAME​ ​EPARTMENT


D
George K INFRASTRUCTURE
Ryma Sen MEDIA

(½ Mark for correct output)

(viii) ​
SELECT MAX(DOJ), MIN(DOB) FROM EMPLOYEE;

Ans MAX(DOJ)​ ​IN(DOB)


M
2014­06­09 1984­10­19

Page 28 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

(½ Mark for correct output)

Note: In the output queries, please ignore the order of rows.

6 (a) Verify the following using Boolean Laws. 2


U’+ V= U’V’+U’.V +U.V

Ans L.H.S
=U’+ V
=U’.(V+V’)+ V.(U’+ U)
=U’.V + U’.V’ + U’.V + U.V
=U’.V+U’.V’+U.V
=R.H.S
OR
R.H.S
=U’V’+U’.V +U.V
=U’.(V’+ V)+ U.V
=U’.1 + U.V
=U’+ U.V
=U’+ V
=L.H.S

(2 Marks for any valid verification using Boolean Laws)


OR
(1 Mark for partial correct verification using Boolean Laws)

(b) Draw the Logic Circuit for the following Boolean Expression : 2
(X’+Y).Z+W’

Ans

( ½ Mark for X’ and W’)


( ½ Mark for (X’+Y))
( ½ Mark for (X’+Y).Z)
( ½ Mark for (X’+Y).Z+W’)

(c) Derive a Canonical POS expression for a Boolean function F, 1


represented by the following truth table:

P Q R F(P,Q,R)
0 0 0 1
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 1

Page 29 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

1 0 1 0
1 1 0 0
1 1 1 1

Ans F(P,Q,R)= (P+Q+R’)(P+Q’+R)(P’+Q+R’)(P’+Q’+R)


OR
F(P,Q,R)= Π (1,2,5,6)

(1 Mark for the correct POS form)


OR
(½ Mark for writing any two term correctly)
Note: Deduct ½ mark if wrong variable names are used

(d) Reduce the following Boolean Expression to its simplest form


using K‐Map : 3
F(X,Y,Z,W) = ∑(0,1,4,5,6,7,8,9,11,15)

Ans

OR

Simplified Expression: Y’Z’ + X’Y + XZW

( ½ Mark for drawing K‐Map with correct variable names)


( ½ Mark for placing all 1s at correct positions in K‐Map)
( ½ Mark for each of three grouping ​ )
Y’Z’ , X’Y , XZW​
( ½ Mark for writing final expression in reduced/minimal/non
redundant form as ​ )
Y’Z’ + X’Y + XZW ​
Note: Deduct ½ mark if wrong variable names are used

Page 30 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

7 (a) Illustrate the layout for connecting 5 computers in a Bus and a 1


Star topology of Networks.

Ans Bus topology

Star Topology

OR any valid illustration of Bus and Star Topology.

½ Mark for drawing each correct layout)


(​

(b) What kind of data gets stored in cookies and how is it useful? 1

Ans When a Website with cookie capabilities is visited , its server


sends certain information about the browser, which is stored in
the hard drive as a text file. It's a way for the server to remember
things about the visited sites.

(1 Mark for correct kind of data stored)

(c) Differentiate between packet switching over message switching? 1

Ans Packet Switching​ ­follows store and forward principle for fixed packets.
Fixes an upper limit for packet size.

Message Switching​ ­follows store and forward principle for complete


message. No limit on block size.

(1 Mark for any valid differentiation)


OR
(1 Mark for correct definition of Packet Switching only)

(d) Out of the following, which is the fastest (i) wired and (ii) 1
wireless medium of communication?
Infrared, Coaxial Cable, Ethernet Cable, Microwave, Optical Fiber

Ans (i) Wired – Optical Fiber


(ii) Wireless ‐ Infrared OR Microwave

½
(​ Mark each for Wired and Wireless ​
medium of
communication​
)

Page 31 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

(e) What is Trojan Horse? 1

Ans A Trojan Horse is a code hidden in a program, that looks safe but
has hidden side effects typically causing loss or theft of data, and
possible system harm.

(1 Mark for writing correct meaning of Trojan)

(f) Out of the following, which all comes under cyber crime? 1
(i) Stealing away a brand new hard disk from a showroom.
(ii) Getting in someone's social networking account without
his consent and posting on his behalf.
(iii) Secretly copying data from server of a organization and
selling it to the other organization.
(iv) Looking at online activities of a friends blog.

Ans (ii) & (iii)

(½ Mark for choosing each of the correct options)


Note:
● No marks to be given, if all options are there in the answer
● ½ Mark to be deducted, if one extra option is given along
with the correct options

(g) Xcelencia Edu Services Ltd. is an educational organization. It is


planning to set up its India campus at Hyderabad with its head
office at Delhi. The Hyderabad campus has 4 main buildings ‐
ADMIN, SCIENCE, BUSINESS and MEDIA.

You as a network expert have to suggest the best network


related solutions for their problems raised in (i) to (iv), keeping in
mind the distances between the buildings and other given
parameters.

Shortest Distances between various buildings:


ADMIN to SCIENCE 65M
ADMIN to BUSINESS 100m
ADMIN to ARTS 60M
SCIENCE to BUSINESS 75M
SCIENCE to ARTS 60M
BUSINESS to ARTS 50M
DELHI Head Office to HYDERABAD Campus 1600KM

Page 32 of 33
CBSE AISSCE 2015 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)

Number of Computers installed at various building are as follows:


ADMIN 100
SCIENCE 85
BUSINESS 40
ARTS 12
DELHI Head Office 20
`

(i) Suggest the most appropriate location of the server inside the 1
HYDERABAD campus (out of the 4 buildings), to get the best
connectivity for maximum no. of computers. Justify your
answer.

Ans ADMIN ​
(due to maximum number of computers)
OR
ARTS​(due to shorter distance from the other buildings)

(1 Mark for mentioning Correct building name with reason)


OR
(½ Mark to be deducted for not giving reason)
(ii) Suggest and draw the cable layout to efficiently connect 1
various buildings 'within the HYDERABAD campus for
connecting the computers.
Ans Any one of the following

(1 Mark for drawing correct layout)

(iii) Which hardware device will you suggest to be procured by 1


the company to be installed to protect and control the intemet
uses within the campus?

Ans Firewall OR Router

(1 Mark for correct Answer)

(iv) Which of the following will you suggest to establish the 1


online face‐to‐face communication between the people in the
Admin Office of HYDERABAD campus and DELHI Head Office?
(a) E‐mail (b) Text Chat (c) Video Conferencing (d) Cable TV
Ans ​
Video Conferencing

(1 Mark for correct Option / Answer)

Page 33 of 33
Class XII

Computer Science (083)

Marking Scheme

Time Allowed: 3 hours MM: 70

Ques Question and Answers Distribution Total


No of Marks Marks

SECTION A
1 False 1 mark for 1
correct
answer

2 Option b 1 mark for 1


correct
6,20
answer

3 Option c 1 mark for 1


correct
-244.0 answer

4 PYTHON-is-Fun 1 mark for 1


correct
answer

5 Option b 1 mark for 1


correct
8,15
answer

6 Option a 1 mark for 1


correct
PAN
answer

7 Option b 1 mark for 1


correct
del D1["Red"] answer

8 Option b 1 mark for 1


correct
answer

[1]
ceieP0

9 Option d 1 mark for 1


correct
Statement 4 answer

10 Option b 1 mark for 1


correct
WHITE* answer

BLACK*

11 Option b 1 mark for 1


correct
Modulator answer

12 Option c 1 mark for 1


correct
global b answer

13 True 1 mark for 1


correct
answer

14 Option c 1 mark for 1


correct
A candidate key that is not a primary key is a foreign key. answer

15 Circuit 1 mark for 1


correct
answer

16 Option c 1 mark for 1


correct
seek() answer

17 Option d 1 mark for 1


A is false but R is True correct
answer

[2]
18 Option b 1 mark for 1
correct
Both A and R are true but R is not the correct explanation for A answer

SECTION B
19 (i) ½ mark for 1+1=2
each correct
POP3 – Post Office Protocol 3 expansion

URL – Uniform Resource Locator

(ii)

HTML( Hyper text mark Up language)

 We use pre-defined tags


 Static web development language – only focuses on how
data looks
 It use for only displaying data, cannot transport data
 Not case sensistive

XML (Extensible Markup Language) 1 mark for


any one
correct
 we can define our own tags and use them
difference
 Dynamic web development language – as it is used for
No mark to
transporting and storing data be awarded if
 Case sensitive only full form
is given
OR

(i) Bandwidth is the maximum rate of data transfer over 1 mark for
correct
a given transmission medium. / The amount of definition
information that can be transmitted over a network.

[3]
(ii) https (Hyper Text Transfer Protocol Secure) is the 1 mark for
correct
protocol that uses SSL (Secure Socket Layer) to
difference.
encrypt data being transmitted over the Internet.
Therefore, https helps in secure browsing while http
does not.

20 def revNumber(num): ½ mark for 2


rev = 0 each
rem = 0 correction
while num > 0: made
rem =num %10
rev = rev*10 + rem
num = num//10
return rev
print(revNumber(1234))

21 ½ mark for 2
correct
function
header

½ mark for
correct loop

½ mark for
correct if
statement

½ mark for
displaying
OR
the output

½ mark for
correct
function
header

½ mark for
using split()

[4]
½ mark for
adding to
tuple

½ mark for
return
statement

Note: Any other correct logic may be marked

22 4*L ½ mark for 2


each correct
33*4
line of output
21*S
10*6
23 (i) L1.insert(2,200) 1 mark for 1+1=2
each correct
(ii) message.endswith('.') statement

OR
import statistics
1 mark for
print( statistics.mode(studentAge) )
correct
import
statement

1 mark for
correct
command
with mode()
and print()

24 SQL Command to add primary key: 1 mark for 2


correct
ALTER TABLE Employee ADD EmpId INTEGER ALTER TABLE
command
PRIMARY KEY;

[5]
As the primary key is added as the last field, the command for
inserting data will be: 1 mark for
correct
INSERT INTO Employee INSERT
VALUES("Shweta","Production",26900,999); command

Alternative answer:
INSERT INTO
Employee(EmpId,Ename,Department,Salary)
VALUES(999,"Shweta","Production",26900);
OR
To delete the attribute, category:
1 mark for
ALTER TABLE Sports correct
DROP category; ALTER TABLE
command
with DROP
To add the attribute, TypeSport
1 mark for
correct
ALTER TABLE Sports ALTER TABLE
command
ADD TypeSport char(10) NOT NULL; with ADD

25 10.0$20 1 mark for 2


each correct
10.0$2.0###
line of output

SECTION C
26 ND-*34 ½ mark for 3
each correct
character

27

1 mark for 1*3=3


each correct
(i)
output
COUNT(DISTINCT SPORTS)

[6]
4

(ii)
CNAME SPORTS
AMINA CHESS

(iii)
CNAME AGE PAY
AMRIT 28 1000
VIRAT 35 1050

28 1 mark for 3
correctly
opening and
closing files

½ mark for
correctly
reading data

1 mark for
correct loop
and if
statement
OR
½ mark for
displaying
data

1 mark for
correctly
opening and
closing the
files

[7]
½ mark for
correctly
reading data

1 mark for
correct loop
and if
statement

½ mark for
displaying
the output.

Note: Any other correct logic may be marked


29 (i) 1 mark for 1*3=3
each correct
UPDATE Personal
query
SET Salary=Salary + Salary*0.5
WHERE Allowance IS NOT NULL;

(ii)
SELECT Name, Salary + Allowance AS
"Total Salary" FROM Personal;

(iii)
DELETE FROM Personal
WHERE Salary>25000

[8]
30 1 ½ marks for 3
each function

SECTION D
31 (i) 1 mark for 1*4=4
each correct
SELECT PName, BName FROM PRODUCT P,
query
BRAND B WHERE P.BID=B.BID;
(ii)
DESC PRODUCT;
(iii)
SELECT BName, AVG(Rating) FROM PRODUCT
P, BRAND B
WHERE P.BID=B.BID
GROUP BY BName
HAVING BName='Medimix' OR
BName='Dove';
(iv)
SELECT PName, UPrice, Rating
FROM PRODUCT
ORDER BY Rating DESC;

[9]
32 ½ mark for 4
accepting
data
correctly

½ mark for
opening and
closing file

½ mark for
writing
headings

½ mark for
writing row

½ mark for
opening and
closing file

½ mark for
reader object

½ mark for
print heading

½ mark for
printing data

SECTION E
33 a) 1 mark for 1*5=5
each correct
Bus Topology
answer
ENGINEERING
Admin

BUSINESS
MEDIA

[10]
b) Switch
c) Admin block, as it has maximum number of computers.
d) Microwave
e) No, a repeater is not required in the given cable layout as the
length of transmission medium between any two blocks does not
exceed 70 m.

34 (i) 1 mark for 2+3=5


each correct
r+ mode:
difference
 Primary function is reading
( minimum
 File pointer is at beginning of file two
differences
 if the file does not exist, it results in an error
should be
w+ mode: given)
 primary function is writing
 if the file does not exist, it creates a new file.
 If the file exists, previous data is overwritten
 File pointer is at the beginning of file
(ii)
½ mark for
correctly
opening and
closing files

½ mark for
correct try
and except
block

½ mark for
correct loop

1 mark for
correctly
copying data

[11]
½ mark for
correct
return
statement

½ mark for
correctly
opening and
closing files

½ mark for
correct try
and except
block

½ mark for
correct loop

½ mark for
OR correct if
(i) Text files: statement

 Extension is .txt 1 mark for


correctly
 Data is stored in ASCII format that is human readable
displaying
 Has EOL character that terminates each line of data data
stored in the text files

Binary Files
 Extension is .dat
 Data is stored in binary form (0s and 1s), that is not
human readable.

(ii)

[12]
Note: Any other correct logic may be marked
35 (i) Domain is a set of values from which an attribute can ½ mark for 1+4=5
correct
take value in each row. For example, roll no field can
definition
have only integer values and so its domain is a set of
½ mark for
integer values correct
example

(ii)

½ mark for
importing
correct
module

1 mark for
correct
connect()

½ mark for
correctly
accepting the
input
Note: Any other correct logic may be marked
1 ½ mark for
correctly

[13]
executing the
query

½ mark for
correctly
using
OR commit()

(i) All keys that have the properties to become a primary


key are candidate keys. The candidate keys that do not
become primary keys are alternate keys.
1 mark for
(ii) correct
difference

½ mark for
importing
correct
module

1 mark for
correct
connect()

1 mark for
correctly
executing
the query

½ mark for
correctly
using
fetchall()

1 mark for
correctly

[14]
displaying
data

[15]

You might also like