Documente Academic
Documente Profesional
Documente Cultură
MARKING SCHEME
Subject: Computer Science
Class: XII (2017-18)
Page No. 1
Aglasem Schools
the given C++ program. Identify the header files which are wrongly suggested by
Raman.
Program:
Ans stdio.h
conio.h
Ans #include<iostream.h>
#include<conio.h>
typdef int Num; //Typedef should be written as typedef
Num full=100;
Page No. 2
Aglasem Schools
Num Calc(int X)
{
full=(X>2)?1:2;
return (full%2); //; is missing
}
void main()
{
int full=1000;
full=Calc(::full);
cout<<::full<<”::”<<full<<endl;
}
Ans Output:
New Encrypted Message after Pass 1 is : Dpnqvufs3128
New Encrypted Message after Pass 2 is : Eqorwvgt4239
Page No. 3
Aglasem Schools
Ans Output:
B:380
A:350
C:275
Page No. 4
Aglasem Schools
(a) 5:6:6:6:
(b) 4:7:5:3:
(c) 8:6:1:2:
(d) 7:5:3:1
Ans Output:
Option (a) & (c)
Maximum value of Pick will be 8
Minimum value of Pick will be 1
Page No. 5
Aglasem Schools
In the above example, public member Mult( ) is invoked using the object p of class
PRODUCT. Thus, demonstrating Data abstraction.
Page No. 6
Aglasem Schools
(i) Give the name of the feature of OOP which is implemented by Function 1 &
2 together in the above class Game.
(ii) Anuj made changes to the above class Game and made Function 3 private.
Will he be able to execute the Line 1 successfully given below? Justify.
void main()
{
Game ABC; //Line 1
}
Ans (i) Polymorphism or Function Overloading or Constructor Overloading
(1 mark for correct answer)
(ii) Yes, an error “Destructor for Game is not accessible” will come. As there is a
destructor defined in the class and it cannot be made private.
(1/2 mark for correct answer Yes)
(1/2 mark for correct reason)
(c) Define a class Bill in OOP with the following specification:- 4
Private members:
1. Bill_no - type long(bill number)
2. Bill_period - type integer(number of months)
Page No. 7
Aglasem Schools
Public members:
1. A member function New_Bill() that will accept the values for Bill_no,
Bill_period, No_of_calls, Payment_mode from the user and invoke
Caluclate_Bill() to assign the value of Amount.
2. A member function Print_Bill() that will display all details of a Bill.
Page No. 8
Aglasem Schools
Ans
Page No. 9
Aglasem Schools
(i) Write name of the class whose constructor is invoked first on the creation of a
new object of class Country.
(ii) Write name of the data members which are accessible through the object of
class Country.
(iii) List name of the members which are accessible through the member function
“void New_Country()”.
(iv) What will be the size(in bytes) of an object of class Country & State
respectively.
Page No. 10
Aglasem Schools
address of the array and the memory address of element stored at location A[30][25]?
Ans Row-major Formula:- A[I][J]= B+ W*((I-Lr)*Nc + (J-Lc))
Nr=50, Nc=30, B=?, W=4, Lr=0, Lc=0, A(10,15)=21500
A[10][15]= B + 4*((10-0)*30 + (15-0))
21500= B + 4*(300+15)
21500=B + 4*315
B=21500 – 1260
B=20240
Page No. 12
Aglasem Schools
Ans
Page No. 13
Aglasem Schools
Ans
Page No. 14
Aglasem Schools
(i)
Write Statement 1 to position the file pointer to the appropriate place so that
the data updation is done for the correct Route.
(ii) Write Statement 2 to perform the write operation so that the updation is done
in the binary file “ROUTE.DAT”.
Page No. 15
Aglasem Schools
Page No. 16
Aglasem Schools
Write a function named Change_Item(int Id, float Pr) to modify the price of the item
whose Itemid & new price are passed as an argument.
Ans
For example:
Page No. 17
Aglasem Schools
continue statement forces next iteration when i becomes 3 , bypassing the print
statement .Thus ,in the output 3 is missing.
(b) Identify and write the name of the module to which the following functions belong: 1
i. ceil( ) ii. findall()
(c) Observe the following Python code very carefully and rewrite it after removing all 2
syntactical errors with each correction underlined.
Page No. 18
Aglasem Schools
Ans
Ans 14 : 7
8 : 49
Ans ['d', 'o', 'I', 'i', 't', '@', '@', '1', '1', '2', '3', '!', '!']
(½ mark for converting „D‟ to „d‟)
(½ mark for converting „I‟ to „i‟)
(½ mark for substituting each „ „ with the consecutive character)
(f) Study the following program and select the possible output(s) from the options (i) to (iv) 2
Page No. 19
Aglasem Schools
following it. Also, write the maximum and the minimum values that can be assigned to
the variable Y.
i) 0 : 0
ii) 1 : 6
iii) 2 : 4
iv) 0 : 3
Ans i) and iv) are the possible output(s)
'+' operator behaves differently with different data types. With integers it adds the two
numbers and with strings it concatenates or joins two strings.
For example: Print 8+9 will give 17 and Print "Python" + "programming" will give the
output as Python programming.
(b) Observe the following Python code and answer the questions (i) and (ii):
(i) How is data member „count‟ different from data member „Author‟? 1
Ans Data member „count‟is a Class attribute whereas the data member „Author‟ is an
Page No. 20
Aglasem Schools
Instance attribute.
Class Attributes belong to the class itself. These attributes will be shared by all the
instances. Such attributes are defined in the class body part, usually at the top, for
legibility.
Attributes defined for each class instance are known as Instance Attributes. These are
called instance attributes and they belong to each instance/object of a class.
Page No. 21
Aglasem Schools
Ans
(d) Answer the questions (i) and (ii) based on the following: 4
Page No. 22
Aglasem Schools
(ii) Predict the output that will be produced on the execution of the following statements :
Ans
Page No. 23
Aglasem Schools
Q3 (a) Write the definition of a function Reverse(X) in Python, to display the elements in 2
reverse order such that each displayed element is the twice of the original element
(element * 2) of the List X in the following manner:
Example:
If List X contains 7 integers is as follows:
X[0] X[1] X[2] X[3] X[4] X[5] X[6]
4 8 7 5 6 2 10
After executing the function, the array content should be displayed as follows:
20 4 12 10 14 16 8
Ans
Blank 1
:
:
i. Fill in the blank 1 with a statement to insert OID in the Queue maintained using List
L.
ii. Complete the definition of delorder() to delete OID from the Queue maintained using
List L, the function should return the OID being deleted or -1 in case the Queue is
empty.
Ans: i. self.L.append(self.OID)
Page No. 24
Aglasem Schools
10 Push(10) 10
40 Push(40) 10,40
25 Push(25) 10,40,25
- Pop(25) 10,15
Pop(40)
Push(40-25)
=15
* Pop(15) 150
Pop(10)
Push(10*15)
=150
15 Push(15) 150,15
4 Push(4) 150,15,4
* Pop(4) 150,60
Pop(15)
Push(15*4)=60
Page No. 25
Aglasem Schools
Page No. 26
Aglasem Schools
Ans:
SECTION – C
Q5 (a) Differentiate between DDL & DMLcommands. Identify DDL & DML commands from 2
the following:-
(UPDATE, SELECT, ALTER, DROP)
Ans DDL stands for Data Definition language and comprises of commands which will
change the structure of database object.
DML stands for Data Manipulation Language and comprises of commands which
are used to insert, edit, view & delete the data stored in a database object.
DDL Commands: ALTER, DROP
DML Commands: UPDATE, SELECT
Page No. 27
Aglasem Schools
MobileStock
S_Id M_Id M_Qty M_Supplier
S001 MB004 450 New Vision
S002 MB003 250 Praveen Gallery
S003 MB001 300 Classic Mobile Store
S004 MB006 150 A-one Mobiles
S005 MB003 150 The Mobile
S006 MB006 50 Mobile Centre
Write the SQL query for questions from (i) to (iv) & write the output of SQL command
for questions from (v) to (viii) given below:-
(i) Display the Mobile company, Mobile name & price in descending order of
their manufacturing date.
(ii) List the details of mobile whose name starts with „S‟.
(iii) Display the Mobile supplier & quantity of all mobiles except „MB003‟.
(iv) To display the name of mobile company having price between 3000 & 5000.
(v) SELECT M_Id, SUM(M_Qty) FROM MobileStock GROUP BY M_Id;
(vi) SELECT MAX(M_Mf_Date), MIN(M_Mf_Date) FROM MobileMaster;
(vii) SELECT M1.M_Id, M1.M_Name, M2.M_Qty, M2.M_Supplier FROM
MobileMaster M1, MobileStock M2 WHERE M1.M_Id=M2.M_Id AND
M2.M_Qty>=300;
Page No. 28
Aglasem Schools
(v)
M_Id SUM(M_Qty)
MB004 450
MB003 400
MB001 300
MB006 200
(½ mark for correct output)
(vi)
MAX(M_Mf_Date) MIN(M_Mf_Date)
2017-11-20 2010-08-21
(½ mark for correct output)
(vii)
M_Id M_Name M_Qty M_Supplier
MB004 Unite3 450 New_Vision
Page No. 29
Aglasem Schools
Page No. 30
Aglasem Schools
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 1
Ans SOP Form is : X‟.Y‟.Z + X‟.Y.Z‟ + X.Y.Z‟ + X.Y.Z
Quad 1: (V‟+Z')
Pair 1: (U+V+Z)
Pair 2: (U‟+V‟+W)
POS Form: (V‟+Z').(U+V+Z).(U‟+V‟+W)
Page No. 32
Aglasem Schools
Main
Admin Building
Academic
Finance
Main Admin 50
*********
Page No. 35