ANSWER WITH MARKING SCHEME

SECOND PREBOARD EXAMINATION 2014-15 FOR CLASS XII

Note: Answers given here are suggestive. All alternate correct answers to be considered.

QUESTION / ANSWER WITH MARKING SCHEME / Mark
Q.1 / (a) Local Variables are variables declared inside a function or a block. Their scope is limited to the function or block in which declared. Memory is allocated in the stack area. They are recreated each time function is called.
Global Variables are variables declared outside all the functions. Their scope is the entire program and is they are accessible to all. They continue to occupy memory even if they are no more in use.
e.g.int x, y;
//global variables x and y accessible to add( ) main( )
int add( )
{return x+y; }
void main( )
{ x=10;y=20;
int a=add();
//local variable a accessible within main( ) only
cout<a;
}
(1 mark each for definition of local and global variable, 1 mark for example) / 2
(b)stdio.h and string.h (½ mark for each correct header file) / 1
(c) 4
16
(1 mark for each line of correct output) / 2
(d) # include <iostream.h
voidCallFun(int X, intY=10)
//return type was missing : was used in place of =
{
cout < X < "\t" < Y < endl ; // ; was missing
}
void main( )
{ int One=1, Two=2;// variable declaration was missing
CallFun(One,Two);
CallFun(One);
}
(½ mark for each correction) / 2
(e) 1#!
2#t!
3#ht!
4#ght!
(Full 3 marks for correct answer. 1 mark to be deducted for incorrect use end of line, # ) / 3
(f) (i) and (iii) will not be expected (2 marks for identifying both options) / 2
Q.2 / (a) Private members are never inherited where as Protected members can be inherited to the derived classes. They remain protected when inherited publicly or protectedly and become private when inherited privately.
(full 2 marks for specifying the difference correctly w.r.t. inheritance) / 2
(b) (i) Function 4 is called a destructor and it gets executed automatically when the objects go out of scope.
(ii) Function2 gets executed when S1 is created and Function3 gets executed when S2 is created
(1mark each for correct answer to i and ii) / 2
(c) class TAXPAYER
{ private:
char Name[30], PAN[10];
double Income, Tax;
void Compute( )
{ if(Income >500000)
Tax= Income*0.20;
else if(Income>200000)
Tax= Income*0.1;
else
Tax=0.0;
}
public:
void GET( )
{ cout<"Enter Name : ";
gets(Name);
cout<"\nPAN Number : ";
cin>PAN;
cout<"\nTaxable Income";
cin>Income;
}
void PRINT( )
{ Compute( );
cout<Name<’\t’<PAN<’\t’<Income<’\t’<Tax<endl;
}
};
Note: Functions may be defined outside the class
1 mark for correct syntax of class definition, 1 mark for correct declaration of data members, 1 mark for correct definition of compute( ) and its invocation, 1 mark for definition of other member functions / 4
(d) (i) Multiple Inheritance.
(ii) 42 bytes (10+20+10+2)
(iii) AssignSal( ), Enter( ), Display( )
(iv) private data members AffNoSchName and protected data members Attendance & Salary
(1 mark each for correct answer to I, ii, iii, iv) / 4
Q3 / (a)void insSort(int a[ ], int n)
{ int i, j, x;
for( i = 1 ; i < n ; i++)
{ x = a[ i ];
for(j = i – 1; j >= 0 & x < a [ j ]; j– –)
{ a[j+1]=a[j]; }
a[j+1]=x;
}
}
(½ mark for correct function header, ½ mark for variable declaration, 1 mark for correct loop, 1mark for logic) / 3
(b)Given, Size of element w=2, row size m=30, column size n=30.
If base address = B
Address of X[10][10] stored in column major order
5000 = B + 2*[10 + 10*30]
=> B = 5000 – 2*(10+300) = 5000 – 2*310 = 5000 – 620 = 4380
So, address of X[20][15] = B + 2 * [20 + 15*30]
= 4380 + 2*(20+450)
= 4380 + 2 * 470
= 4380 + 940
= 5320
(1 mark for correct formula & substituting correct values in the formula, 1 mark for calculating base address, 1 mark for final correct address) / 3
(c)void InsertQ(float Queue[ ], float X)
{
if(Rear==N-1)
{cout<”\n Overflow! No more space to insert”;
exit(0);
}
if(Rear==-1)
Front=Rear=0;
else
Rear++;
Queue[Rear]=X
}
(1 mark for correct function header with arguments, 1 mark each for checking overflow, 1 mark for empty condition, 1 mark for insertion ) / 4
(d)void Shift(int a[ ],int n)
{inti,x=a[0];
for(i=1;i<n;i++)
a[i-1]=a[i];
a[n-1]=x;
}
(1 mark for function and variable declaration,1 mark for correct loop and logic) / 2
(e)
Scanned character / Status of stack
12 / 12
7 / 12, 7
3 / 12, 7, 3
– / 12, 4 (7 – 3 = 4)
/ / 3 (12 / 4 = 3)
2 / 3, 2
1 / 3, 2, 1
5 / 3, 2, 1, 5
+ / 3, 2, 6 (1 + 5 = 6)
* / 3, 12 (2 * 6 = 12)
+ / 15 (3 + 12 = 15 )
(Full 2 marks for correct answer with status of stack (1 mark for correct answer without showing status of stack) / 2
Q4 / (a) Statement1: File.seekp((RecNo-1)*sizeof(B),ios::beg);
Statement2:File.write((char*) &B, sizeof(B) )
(½ mark for each correct statement) / 1
(b)void Dislay( )
{char line[80];
Ifstreamfs(“NOTES.TXT”);
If(!fs)
{
cout<”Sorry! File opening failed.”;
exit(0);
}
while(!fs.eof())
{
fs.getline(line,80,’\n’);
if(line[0]==’S’||line[0]==’T”)
cout<line<endl;
}
fs.close();
}
( ½ mark for opening file using any method, ½ mark for reading a line of text using any method, 1 mark for comparison and output) / 2
(c)void Search( )
{int found=0;
fstreamfs(“STUDENT.DAT”,ios::in|ios::binary);
STUDENT S;
If(!fs)
{cout<”Sorry! Cannot open file for reading”;
exit(0);
}
while(fs.read((char*) &S, sizeof(S) ) )
{ if (S.RetAdmNo( )==154)
{S.DisplayData();
found = 1 ;
}
}
if (Found==0)
cout < “Record does not exist”;
fs.close( ) ;
}
( ½ mark for opening file, ½ mark for object/variables declaration, 1 mark for reading record, 1 mark for comparison &displaying record) / 3
Q5 / (a) A primary key is a set of one or more attribute used to uniquely identify tuples or records in a table/relation
(1 mark for correct answer) / 1
(b) char is used for fixed length character data where asvarchar is used for variable length character data
(1 mark for correct answer) / 1
(c) i) SELECT * FROM Consumer ORDER BY ConsumerName DESC
(ii) SELECT StationaryName, Price FROM Stationary
WHERE Price>=10 AND Price<=15
(iii) SELECT C.ConsumerName,C.City, S.StationaryName
FROM Stationary S, Consumer C
WHERE C.S_ID=S.S+ID AND S.Company="Reynolds";
(i)UPDATE Stationary SET Price=Price+2
(v)
S_ID / StationaryName / Company / Price
DP01 / Ball Pen / Reynolds / 10
(vi)
DISTINCT City
Delhi
Mumbai
Bangalore
(vii)
Company / MAX(Price) / MIN(Price) / COUNT(*)
Reynolds / 15 / 10 / 2
Natraj / 5 / 3 / 2
Apsara / 3 / 3 / 1
(viii)
C.ConsumerName / S.StationaryName / S.Price
Pen House / Pencil / 6
Write Well / Gel pen / 15
Topper / Ball pen / 10
Good Learner / Pencil / 5
Motivation / Pencil / 6
(1 mark each for correct SQL statement from i to iv and ½ mark each for each correct output from v to viii) / 4 + 2
Q6 / (a)LHS A + A'B = A.1 + A'.B (using A.1=A)
= A. (1+B) + A'.B (using 1+B=1)
= A + A.B + A'.B (using distributive law)
= A + (A+A').B (using distributive law)
=A + 1.B (using A+A'=1)
= A +B(RHS) (using 1.B=B)
Or RHS= A + B = A + 1. B
= A + (A+A').B
= A + A.B + A'.B
= A.(1+B) + A'.B
= A.1 + A'.B
=A + A'BLHS
(Full 2 marks for correct proof using laws of Boolean algebra) / 2
( b) Logic circuit for ((A+B')(B+C)')'
( ½ mark for representing A+B', ½ mark for (B+C)', 1 mark for ((A+B')(B+C)') / 2
( c) POS expression for given truth table is(A+B+C').(A'+B+C).(A'+B'+C)
A / B / C / F / M
0 / 0 / 0 / 1
0 / 0 / 1 / 0 / A+B+C'
0 / 1 / 0 / 1
0 / 1 / 1 / 1
1 / 0 / 0 / 0 / A'+B+C
1 / 0 / 1 / 1
1 / 1 / 0 / 0 / A'+B'+C
1 / 1 / 1 / 1
(1 mark for correct POS form) / 1
( d) Simplification of Boolean expression is A'C'+A'D'+C'D'
00(C'D') / 01(C'D) / 11(CD) / 10(CD')
00(A'B') / 1 / 1 / 0 / 1
01(A'B) / 1 / 1 / 0 / 1
11(AB) / 1 / 0 / 0 / 0
10(AB') / 1 / 0 / 0 / 0
Logic circuit for reduced expression is
(1 mark for drawing k-map & placing 1s at correct position, ½ mark for correct grouping, 1 mark for writing correct minimal form, ½ mark for logic circuit) / 3
Q7 / (a)Firewall is a system designed to prevent unauthorized access to or from a private network, usually to prevent unauthorized Internet users from accessing intranets.
(1 mark for correct answer) / 1
(b) GPRS – General Packet Radio System
(c)SIM – Subscriber's Identity Module
( ½ mark for each correct expansion) / 1
(d)Personal Area Network (PAN)
(1 mark for correct answer) / 1
(e)HTTP (Hyper Text Transfer Protocol) , FTP (File Transfer Protocol)
(1 mark for specifying name of any two protocols) / 1
(e)
LOCAL AREA NETWORK / WIDE AREA NETWORK
Limited to few kilometers
Data rate of several mbps
Owned by single organization
Very low error rates
Ex - Ethernet is a LAN (developed by Xerox corp) / Span across countries
Data rate of 1-8 mbps
Owned by multiple organization
Comparatively higher error rates
Ex - Internet is the largest WAN
(1 mark for LAN characteristics, 1mark for WAN characteristics) / 2
(f) (i) A possible cable layout to connect all the blocks together (economically with minimum distance) is
(ii) Block C is the most suitable place to house the server as it has maximum number of computer
(iii) Repeater will be needed between blocks B and D since distance between them is more than 100 mts and switches will be used in all blocks to connect their computers locally.
(iv) Satellite communication
(1 mark for each for correct answer to i, ii, iii & iv) / 4

.