Computer Science: Series GBM
Computer Science: Series GBM
COMPUTER SCIENCE
General Instructions :
(v) It is compulsory to mention on the page 1 in the answer book whether you
are attempting SECTION A or SECTION B.
(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 *Point, Score[]={100,95,150,75,65,120};
Point = Score;
for(int L = 0; L<6; L++)
{
if((*Point)%10==0)
*Point /= 2;
else
*Point -= 2;
if((*Point)%5==0)
*Point /= 5;
Point++;
}
for(int L = 5; L>=0; L--)
cout<<Score[L]<<"*";
}
91 3 P.T.O.
(f) Look at the following C++ code and find the possible output(s) from
the options (i) to (iv) following it. Also, write the maximum values
that can be assigned to each of the variables N and M. 2
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 N=random(3),M=random(4);
int DOCK[3][3] = {{1,2,3},{2,3,4},{3,4,5}};
(i) (ii)
1 2 3 1 2 3
2 3 4 2 3 4
3 4 5
(iii) (iv)
1 2 1 2
2 3 2 3
3 4
91 4
2. (a) Differentiate between protected and private members of a class in
context of Object Oriented Programming. Also give a suitable
example illustrating accessibility/non-accessibility of each using a
class and an object in C++. 2
(b) Observe the following C++ code and answer the questions (i) and (ii).
Note : Assume all necessary files are included.
class TEST
{
long TCode;
char TTitle[20];
float Score;
public:
TEST() //Member Function 1
{
TCode=100;strcpy(TTitle,"FIRST Test");Score=0;
}
TEST(TEST &T) //Member Function 2
{
TCode=E.TCode+1;
strcpy(TTitle,T.TTitle);
Score=T.Score;
}
};
void main()
{
_______________ //Statement 1
_______________ //Statement 2
}
91 5 P.T.O.
(c) Write the definition of a class BOX in C++ with the following
description : 4
Private Members
- BoxNumber // data member of integer type
Public Members
- GetBox() // A function to allow user to enter values of
// BoxNumber and Side. Also, this
// function should call ExecArea() to calculate
// Area
int X1;
protected:
float X2;
public:
First();
Note :
The function should only alter the content in the same array.
The function should not copy the altered content in another
array.
The function should not display the altered content of the
array.
Assuming, the Number of elements in the array are Even.
1 2 1
2 1 4
3 4 5
4 5 3
5 3 2
The function should calculate the sum and display the following :
Sum of Middle Column : 15
91 8
(c) ARR[15][20] is a two-dimensional array, which is stored in the
memory along the row with each of its elements occupying 4 bytes.
Find the address of the element ARR[5][15], if the element
ARR[10][5] is stored at the memory location 35000. 3
struct GIFT
{
int GCODE; //Gift Code
char GDESC[20]; //Gift Description
GIFT *Link;
};
class STACK
{
Gift *TOP;
public:
STACK(){TOP=NULL;}
void PUSHGIFT();
void POPGIFT();
~STACK();
};
X–(Y+Z)/U*V
91 9 P.T.O.
4. (a) Polina Raj has used a text editing software to type some text in an
article. After saving the article as MYNOTES.TXT, she realised that
she has wrongly typed alphabet K in place of alphabet C everywhere
in the article.
Write a function definition for PURETEXT() in C++ that would
display the corrected version of the entire article of the file
MYNOTES.TXT with all the alphabets ――K‖‖ to be displayed as an
alphabet ――C‖‖ on screen. 3
Note : Assuming that MYNOTES.TXT does not contain any C alphabet
otherwise.
Example :
If Polina has stored the following content in the file MYNOTES.TXT :
void SHOWCASE()
{
cout<<PCODE<<":" <<PTYPE<<endl;
}
char *GETPTYPE(){return PTYPE;}
};
91 10
(c) Find the output of the following C++ code considering that the
binary file CLIENTS.DAT exists on the hard disk with a data of 200
clients : 1
class CLIENTS
{
int CCode;char CName[20];
public:
void REGISTER(); void DISPLAY();
};
void main()
{
fstream File;
File.open("CLIENTS.DAT",ios::binary|ios::in);
CLIENTS C;
File.seekg(6*sizeof(C));
File.read((char*)&C, sizeof(C));
cout<<"Client Number:"<<File.tellg()/sizeof(C) + 1;
File.seekg(0,ios::end);
cout<<" of "<<File.tellg()/sizeof(C)<<endl;
File.close();
}
SECTION B
[Only for candidates, who opted for Python]
91 12
I1=INVENTORY()
I2=INVENTORY(105,"Thumb Pin",50)
I3=INVENTORY(102,"U Clip")
I1.Procure(25)
I2.Issue(15)
I3.Procure(50)
I1.Status()
I3.Status()
I2.Status()
(f) What are the possible outcome(s) executed from the following code ?
Also specify the maximum and minimum values that can be
assigned to the variable N. 2
import random
NAV = ["LEFT","FRONT","RIGHT","BACK"];
NUM = random.randint(1,3)
NAVG = ""
for C in range (NUM,1,-1):
NAVG = NAVG+NAV[I]
print NAVG
Instance Attributes
- BoxID # Numeric value with a default value 101
- Side # Numeric value with a default value 10
- Area # Numeric value with a default value 0
Methods :
- ExecArea() # Method to calculate Area as
# Side * Side
- NewBox() # Method to allow user to enter values of
# BoxID and Side. It should also
# Call ExecArea Method
- ViewBox() # Method to display all the Attributes
91 14
3. (a) What will be the status of the following list after the First, Second
and Third pass of the bubble sort method used for arranging the
following elements in ascending order ? 3
Note : Show the status of all the elements after each pass very
clearly underlining the changes.
52, 42, –10, 60, 90, 20
4. (a) Differentiate between file modes r+ and rb+ with respect to Python. 1
91 15 P.T.O.
class Factory :
def __init__(self,FID,FNAM):
self.FCTID = FID # FCTID Factory ID
self.FCTNM = FNAM # FCTNM Factory Name
self.PROD = 1000 # PROD Production
def Display(self):
print self.FCTID,":",self.FCTNM,":", self.PROD
SECTION C
[For all the candidates]
5. (a) Observe the following table MEMBER carefully and write the name
of the 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 : 2
MEMBER
NO MNAME STREAM
RESULT
NO MNAME STREAM
(b) Write SQL queries for (i) to (iv) and find outputs for SQL queries (v)
to (viii), which are based on the tables. 6
91 16
DVD
MEMBER
91 17 P.T.O.
6. (a) State DeMorgan‖s Laws of Boolean Algebra and verify them using
truth table. 2
(b) Draw the Logic Circuit of the following Boolean Expression using
only NOR Gates : 2
(A+B).(C+D)
(d) Reduce the following Boolean Expression to its simplest form using
K-Map : 3
E (U , V , Z , W ) = (2 , 3 , 6 , 8 , 9 , 10 , 11 , 12 , 13 )
(b) Janish Khanna used a pen drive to copy files from his friend‖s laptop
to his office computer. Soon his computer started abnormal
functioning. Sometimes it would restart by itself and sometimes it
would stop different applications running on it. 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 : 2
(i) Computer Virus
(ii) Spam Mail
(iii) Computer Bacteria
(iv) Trojan Horse
91 18
(c) Ms. Raveena Sen is an IT expert and a freelancer. She recently used
her skills to access the Admin password for the network server of
Super Dooper Technology Ltd. and provided confidential data of the
organization to its CEO, informing him about the vulnerability of
their network security. Out of the following options (i) to (iv), which
one most appropriately defines Ms. Sen ? 2
Justify the reason for your chosen option :
(i) Hacker
(ii) Cracker
(iii) Operator
(iv) Network Admin
91 19 P.T.O.
Number of computers installed at various blocks are as follows :
Accounts Block 30
Admin Block 40
91 20 1,03,000
CBSE AISSCE 2016-2017 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++
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) new
(ii) While
(iii) case
(iv) Num_2
(b) Anil typed the following C++ code and during compilation he found three errors 1
as follows:
(i) Function strlen should have prototype
(ii) Undefined symbol cout
(iii) Undefined symbol endl
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 Txt[] = "Welcome";
for(int C= 0; C<strlen(Txt); C++)
Txt[C] = Txt[C]+1;
cout<<Txt<<endl;
}
Page #1 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)
Ans string.h
iostream.h OR fstream.h OR iomanip.h
(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 Alphabet:";
cin>>CH;
switch(CH)
(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 Diff(N1,N2) ((N1>N2)?N1-N2:N2-N1)
void main()
{
int A,B,NUM[] = {10,23,14,54,32};
for(int CNT =4; CNT>0; CNT--)
{
Page #2 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)
A=NUM[CNT];
B=NUM[CNT-1];
cout<<Diff(A,B)<<'#';
}
}
Ans 22#40#9#13#
(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 *Point, Score[]={100,95,150,75,65,120};
Point = Score;
for(int L = 0; L<6; L++)
{
if((*Point)%10==0)
*Point /= 2;
else
*Point -= 2;
if((*Point)%5==0)
*Point /= 5;
Point++;
}
for(int L = 5; L>=0; L--)
cout<<Score[L]<<"*";
}
Ans 12*63*73*15*93*10*
Note:
● Deduct ½ Mark for not considering any/all * as separator and or writing
the values in different lines
● Deduct ½ Mark if the output written in reverse order as
10*93*15*73*63*1 2*
● Full 3 Marks to be awarded if “Multiple declaration/syntax error for L”
is mentioned
(f) Look at the following C++ code and find the possible output(s) from the 2
options (i) to (iv) following it. Also, write the maximum values that can
be assigned to each of the variables N and M.
Note:
Page #3 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)
● 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 N=random(3),M=random(4);
int DOCK[3][3] = {{1,2,3},{2,3,4},{3,4,5}};
for(int R=0; R<N; R++)
{
for(int C=0; C<M; C++)
cout<<DOCK[R][C]<<" ";
cout<<endl;
}
}
(i) (ii)
1 2 3 1 2 3
2 3 4 2 3 4
3 4 5
(iii) (iv)
1 2 1 2
2 3 2 3
3 4
Maximum value of N = 2
Maximum value M = 3
Ans
private protected
Implicit Visibility Mode Explicit Visibility Mode
Page #4 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)
protected:
int Y;
public:
void Z();
};
OR
Any other correct example demonstrating difference between private and
protected members of a class
(Full 2 Marks for any one correct difference between private and protected
members in a class using a suitable code in C++)
OR
(1 Mark for writing any one correct difference between private and
protected members in a class without any example)
(b) Observe the following C++ code and answer the questions (i) and (ii).
Note: Assume all necessary files are included.
class TEST
{
long TCode;
char TTitle[20];
float Score;
public:
TEST() //Member Function 1
{
TCode=100;strcpy(TTitle,”FIRST Test”);Score=0;
}
TEST(TEST &T) //Member Function 2
{
TCode=E.TCode+1;
strcpy(TTitle,T.TTitle);
Score=T.Score;
}
};
void main()
{
___________________ //Statement 1
___________________ //Statement 2
}
Page #5 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)
(c) Write the definition of a class BOX in C++ with following description: 4
Private Members
- BoxNumber // data member of integer type
- Side // data member of float type
- Area // data member of float type
- ExecArea() // Member function to calculate and assign
// Area as Side * Side
Public Members
- GetBox() // A function to allow user to enter values of
// BoxNumber and Side. Also, this
// function should call ExecArea() to calculate
// Area
- ShowBox()// A function to display BoxNumber, Side
// and Area
Page #6 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)
(i) Which type of Inheritance out of the following is illustrated in the above example?
Single Level Inheritance, Multilevel Inheritance, Multiple Inheritance
OR
Page #7 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)
Enter2()
Second::Display()
Enter3()
Display() OR Third::Display()
Ans T.Second::Display();
3 (a) Write the definition of a function AddUp(int Arr[], int N) in C++, in which all even 3
positions (i.e. 0,2,4,...) of the array should be added with the content of the
element in the next position and odd positions (i.e. 1,3,5,...) elements should be
incremented by 10.
Example: if the array Arr contains
23 30 45 10 15 25
Then the array should become
53 40 55 20 40 35
NOTE:
● The function should only alter the content in the same array.
● The function should not copy the altered content in another array.
● The function should not display the altered content of the array.
● Assuming, the Number of elements in the array are Even.
Page #8 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)
Any other correct C++ code for the required function definition.
The function should calculate the sum and display the following:
Sum of Middle Column: 15
OR
Any other correct C++ code for the required function definition
Page #9 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)
LOC(ARR[10][5])
35000 = BaseAddress + W(I*C + J)
35000 = BaseAddress + 4(10*20 + 5)
35000 = BaseAddress + 4(205)
35000 = BaseAddress + 820
BaseAddress = 35000 - 820
= 34180
class STACK
{
Gift *TOP;
public:
STACK(){TOP=NULL;}
void PUSHGIFT();
void POPGIFT();
~STACK();
};
Page #10 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)
NOTE:
GIFT/Gift - Both acceptable
(e) Convert the following Infix expression to its equivalent Postfix expression, showing 2
the stack contents for each step of conversion:
X - ( Y + Z ) / U * V
Ans
ELEMENT Stack POSTFIX
X X
- - X
( -( X
Y -( XY
+ -(+ XY
Z -(+ XYZ
) - XYZ+
/ -/ XYZ+
U -/ XYZ+U
* -* XYZ+U/
V -* XYZ+U/V
XYZ+U/V*-
OR
X-(Y+Z)/U*V = (X-(((Y+Z)/U)*V))
ELEMENT Stack POSTFIX
(
X X
- -
(
(
(
Y XY
+ - +
Z XYZ
) - XYZ+
/ -/
U XYZ+U
Page #11 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)
) - XYZ+U/
* -*
V XYZ+U/V
) XYZ+U/V*
) XYZ+U/V*-
Postfix= XYZ+U/V*-
OR
Any other method for converting the given infix expression to its equivalent
postfix expression showing stack contents.
4. (a) Polina Raj has used a text editing software to type some text in an article. After 3
saving the article as MYNOTES.TXT, she realised that she has wrongly typed alphabet
K in place of alphabet C everywhere in the article.
Write a function definition for PURETEXT() in C++ that would display the corrected
version of the entire article of the file MYNOTES.TXT with all the alphabets “K” to
be displayed as an alphabet “C” on screen.
Note: Assuming that MYNOTES.TXT does not contain any C alphabet otherwise.
Example:
If Polina has stored the following content in the file MYNOTES.TXT:
Page #12 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)
(b) Write a definition for function COUNTPICS ( ) in C++ to read each object of a 2
binary file PHOTOS.DAT, find and display the total number of PHOTOS of type
PORTRAIT. Assume that the file PHOTOS.DAT is created with the help of objects of
class PHOTOS, which is defined below:
class PHOTOS
{
int PCODE;
char PTYPE[20];//Photo Type as “PORTRAIT”,”NATURE”
public:
void ENTER()
{
cin>>PCODE;gets(PTYPE);
}
void SHOWCASE()
{
cout<<PCODE<<":"<<PTYPE<<endl;
}
char *GETPTYPE(){return PTYPE;}
};
Ans void COUNTPICS()
{
ifstream F;
F.open("PHOTOS.DAT",
ios::binary);
int count=0;
PHOTOS obj;
while(F.read((char*)&obj,
sizeof(obj)))
{
if(strcmp(obj.GETPTYPE(),“PORTRAIT”)==0)
count++;
}
cout<<”Number of PORTRAIT photos :”<<count;
F.close(); //IGNORE
}
OR
Any other correct function definition
(½ Mark for opening PHOTOS.DAT correctly)
(½ Mark for reading records from PHOTOS.DAT)
(½ Mark for comparing PHOTOS of type PORTRAIT(ignore case sensitive
checking) with strcmp or strcmpi)
(½ Mark for displaying counter for matching records)
(c) Find the output of the following C++ code considering that the binary file 1
CLIENTS.DAT exists on the hard disk with a data of 200 clients.
class CLIENTS
{
int CCode;char CName[20];
public:
Page #13 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)
Page #14 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)
Ans STRING="WELCOME"
NOTE=""
for S in range(0,8):
print STRING[S]
print S,STRING
Also range(0,8) will give a runtime error as the index is out of range. It should
be range(0,7)
(½ Mark for each for any four corrections)
OR
(1 mark for identifying the errors, without suggesting corrections)
(d) Find and write the output of the following python code: 2
TXT = ["20","50","30","40"]
CNT = 3
TOTAL = 0
for C in [7,5,4,6]:
T = TXT[CNT]
TOTAL = float (T) + C
print TOTAL
CNT-=1
Ans 47.0
35.0
54.0
26.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 INVENTORY:
def __init__(self,C=101,N="Pad",Q=100): #constructor
self.Code=C
self.IName=N
self.Qty=int(Q);
def Procure(self,Q):
self.Qty = self.Qty + Q
def Issue(self,Q):
self.Qty -= Q
def Status(self):
print self.Code,":",self.IName,"#",self.Qty
I1=INVENTORY()
I2=INVENTORY(105,"Thumb Pin",50)
I3=INVENTORY(102,"U Clip")
I1.Procure(25)
I2.Issue(15)
I3.Procure(50)
I1.Status()
I3.Status()
Page #15 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)
I2.Status()
Ans Output
101 : Pad # 125
102 : U Clip # 150
105 : Thumb Pin # 35
( 1 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 2
specify the maximum and minimum values that can be assigned to variable N.
import random
NAV = ["LEFT","FRONT","RIGHT","BACK"];
NUM = random.randint(1,3)
NAVG = ""
for C in range(NUM,1,-1):
NAVG = NAVG+NAV[I]
print NAVG
(i) BACKRIGHT (ii) BACKRIGHTFRONT
Page #16 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)
Regno=1
Marks=75
def __init__(self,r,m): #function 1
self.Regno=r
self.Marks=m
def Assign(self,r,m): #function 2
Regno = r
Marks = m
def Check(self): #function 3
print self.Regno, self.Marks
print Regno, 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 Regno and Marks.
Methods:
- ExecArea() # Method to calculate Area as
# Side * Side
- NewBox() # Method to allow user to enter values of
# BoxID and Side. It should also
# Call ExecArea Method
- ViewBox() # Method to display all the Attributes
Ans can also be given as class BOX( ):
class BOX: #
# or class BOX(Object):
def __init__(self):
self.BoxID=101
self.Side=10
self.Area=0
def ExecArea(self):
self.Area=self.Side*self.Side
def NewBox(self):
self.BoxID=input("Enter BoxID")
self.Side=input("Enter side")
self.ExecArea() # OR ExecArea(self)
def ViewBox(self):
Page #17 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)
print self.BoxID
print self.Side
print self.Area
(½ Mark for correct syntax for class header)
(½ Mark for correct declaration of instance attributes)
(1 Mark for correct definition of ExecArea( ) method)
(1 Mark for correct definition of NewBox( ) with proper invocation of
ExecArea( ))
(1 Mark for correct definition of ViewBox( ))
NOTE:
Deduct ½ Mark if ExecArea( ) is not invoked properly inside NewBox( ) method
(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.
Page #18 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)
52 42 -10 60 90 20
42 52 -10 60 90 20
42 -10 52 60 90 20
42 -10 52 60 90 20
42 -10 52 60 90 20
42 -10 52 60 20 90
II Pass
42 -10 52 60 20 90
-10 42 52 60 20 90
-10 42 52 60 20 90
-10 42 52 60 20 90
-10 42 52 20 60 90
III Pass
-10 42 52 20 60 90
-10 42 52 20 60 90
-10 42 52 20 60 90
-10 42 20 52 60 90
NOTE:
Marks not to be deducted for methods written without using a class
(d) Write definition of a Method MSEARCH(STATES) to display all the state names 2
from a list of STATES, which are starting with alphabet M.
For example:
If the list STATES contains
["MP","UP","WB","TN","MH","MZ","DL","BH","RJ","HR"]
The following should get displayed
MP
MH
MZ
Ans def MSEARCH(STATES):
for i in STATES:
if i[0]=='M':
print i
( ½ mark method header)
( ½ mark for loop)
( ½ mark for checking condition of first letter M)
( ½ mark for displaying value)
(e) Evaluate the following Postfix notation of expression: 2
4,2,*,22,5,6,+,/,-
Ans
Element Stack Contents
4 4
2 4, 2
* 8
22 8,22
5 8, 22, 5
6 8, 22, 5, 6
+ 8, 22, 11
/ 8, 2
- 6
Answer: 6
(½ Mark for evaluation till each operator)
OR
(1 Mark for only writing the Final answer without showing stack
status)
Page #20 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)
4 (a) Differentiate between file modes r+ and r b+ 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.
rb+ Opens a file for both reading and writing in binary format. The file
pointer placed at the beginning of the file.
class Factory:
def __init__(self,FID,FNAM):
self.FCTID = FID # FCTID Factory ID
self.FCTNM = FNAM # FCTNM Factory Name
self.PROD = 1000 # PROD Production
def Display(self):
print self.FCTID,":",self.FCTNM,":",self.PROD
Ans import pickle
def ques4c( ):
f=Factory( )
file=open('FACTORY.DAT','rb')
try:
while True:
f=pickle.load(file)
if f.FCTID==105:
f.Display()
except EOF Error:
pass
file.close() #IGNORE
(½ Mark for correct method header)
(½ Mark for opening the file FACTORY.DAT correctly)
Page #21 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)
RESULT
NO MNAME STREAM
M002 ADITYA HUMANITIES
Degree=3
Cardinality=1
MEMBER
MID NAME DCODE ISSUEDATE
101 AGAM SINGH R102 2017-11-30
103 ARTH JOSEPH F102 2016-12-13
102 NISHA HANS C101 2017-07-24
(i) To display all details from the table MEMBER in descending order of ISSUEDATE.
Page #22 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)
Ans MIN(ISSUEDATE)
2016-12-13
(½ Mark for correct output)
(vi) SELECT DISTINCT DTYPE FROM DVD;
Page #23 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)
Ans DTITLE
A day in life
NOTE:
No marks to be awarded for any other output
6 a. State DeMorgan’s Laws of Boolean Algebra and verify them using truth table. 2
(ii)
A B A+B (A+B)’ A’ B’ A’.B’
0 0 0 1 1 1 1
0 1 1 0 1 0 0
1 0 1 0 0 1 0
1 1 1 0 0 0 0
Ans
(Full 2 Marks for drawing the Logic Circuit for the expression correctly)
OR
Page #24 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)
X Y Z G(X,Y,Z)
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 0
1 1 1 1
Ans
OR
Page #25 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)
E(U,V,Z,W)=UZ’+V’Z+U’ZW’
(½ 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 communication using Optical Fiber and Ethernet Cable in 2
context of wired medium of communication technologies.
Full 2 marks for any one correct difference between Optical Fibre and
Ethernet Cable
OR
1 Mark for writing correct features of any one wired medium out of Optical
Fibre or Ethernet Cable
(b) Janish Khanna used a pen drive to copy files from his friend’s laptop to his office 2
computer. Soon his office computer started abnormal functioning. Sometimes it
would restart by itself and sometimes it would stop different applications running
on it. 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 Virus
(ii) Spam Mail
(iii) Computer Bacteria
(iv) Trojan Horse
Page #26 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)
As a network consultant, you have to suggest the best network related solutions
for them for issues/problems raised by them in (i) to (iv), as per the distances
between various blocks/locations and other given parameters.
Page #27 of 28
CBSE AISSCE 2016-2017 Marking Scheme for Computer Science
(Sub Code: 083 Paper Code 91 Outside Delhi)
(i) Suggest the most appropriate block/location to house the SERVER in the CHENNAI 1
Office (out of the 3 blocks) to get the best and effective connectivity. Justify
your answer.
Page #28 of 28