MS SP 1 CS 02
MS SP 1 CS 02
SAMPLE PAPER
SUB : COMPUTER SCIENCE (083)
MARKING SCHEME
Q. NO ANSWERS MARKS
1 (a). Inline Functions are the functions that are not actually called, 02 marks
rather, their code is expanded (inline) at the point of function
call. The member function of a class, if defined within the
class definition, is inline by default. If defined outside the
function can be made explicitly inline by placing the keyword
in line before its definition.
For example :
In the following example printSq( ) is an inline function.
class Abc
{
int x;
public:
void printSq ( )
{
cout << x*x;
}
};
1
class ABC
{
int x;
static int ctr;
public:
void int (void);
static void prn(void)
{
cout << ctr;
}
};
int ABC :: ctr = 0;
void ABC :: sum (void)
{
x = x+20;
}
1 (d). Ans : NNO@*XRS!* 03 marks
2
(ii) School ( School &t)
{
Score = t.score;
}
2 (c). 04 marks
class TOUR
{
Private:
char TCode [30];
int NoofAdults, NoofKids, Kilometers;
float TotalFare;
public:
TOUR ( )
{
Strcpy ( TCode, “NULL”);
NoofAdults = 0;
NoofKids = 0;
Kilometers = 0;
TotalFare = 0;
}
void AssignFare ( )
{
If (Kilometers >= 1000)
{
Total Fare = NoofAdults *500 + NoofKids * 250;
}
3
}
Topic, Standard
Member Function :
readphysicsbook( ), showphysicsbook ( ),
readtextbook ( ), showtextbook ( ).
4
Member Functions:
readtextbook ( ), showtextbook ( ).
Member function:
readphysicsbook(), showphysicsbook()
(iv) 50 bytes
3.(a) void Get1from2(int First[ ], int second, int size1, int size2) 03 marks
{ int All[50], k, m, n;
k=size1 + size2;
m=0;
n=0;
for (int i=0; i<k; i++)
{
if(i%2==0)
{
All[i]=first[m];
m++;
}
else
{
All[i]=Second[n];
n++;
}
}
}
5
1000= B + 8[4+100]
1000=B + 8(104)
B=168
Address of Array[2][3]= B + W((I-Lr) +r(J-Lc))
= 168 + 8[2-0) + 20(3-0)]
=168 + 8[2 + 60]
=168 +8(62)
=168 + 496
=664
3(c) struct NODE 04 marks
{
int Bno;
char Tilte[20];
NODE * Link;
};
NODE *top;
void POPBOOK()
{
NODE *ptr;
if(top==NULL)
{
cout<<"Underflow";
}
else
{
ptr=top;
top=top->link;
cout<<"Node being deleted contains"<<"Book
No"<<ptr->Bno<<"Title"<<ptr->Title<<endl;
delete ptr;
}
}
6
FirstLargest=A[0][0], SecondLargest=0;
for(int i=0; i<M, i++)
{
for(int j=0; j<N; j++)
{
if (FirstLargest <A[i][j])
{
FirstLargest=A[i][j];
pr1=i;
pc1=j;
}
if((SecondLargest < A[i][j] ) &&(A[i][j] < FirstLargest))
{
SecondLargest=A[i][j];
pr2=i;
pc2=j;
}
}
cout<<FirstLargest<<”,”<<SecondLargest<<endl;
cout<<pr1<<”,”<<pc1<<”:”<<pr2<<”,”<<pc2;
}
7
back
7 15 Operand : push 65,10,15
8 + Binary operator : 65 10+15=25
pop twice
Push the result 65,25
back
9 * Binary operator : 65*25=1625
pop twice
8
4(c) void SEARCH() 03 marks
{
long MNo;
ifstream ifile("CAMERA.DAT, ios::in|ios::binary);
if(!ifile)
{
cout<<"could not open CAMERA.DAT file";
exit(-1);
}
else
{
cout<< “\nEnter the Camera Model No”;
cin >> MNo;
CAMERA C;
int found=0;
while(ifile.read((char*)&c, sizeof(c)))
{
if(C.GetModelNo()== MNo)
{
C.Display();
found=1;
break;
}
}
}
if(found==0)
{
cout<<"\n Given ModelNo Not found";
}
}
Ans 5
(a) Alternative key : A candidate key that is not the primary key is 02 marks :
called an Alternate key. (01+01)
04
Manager 215000
Clerk 135000
32000
Ans 6.
(a) L.H.S = XY + X'Z + YZ 02 marks
= XY + X'Z + 1. YZ
=XY + X'Z + (X+X')YZ
=XY + X'Z + XYZ + X'YZ
=XY + XYZ + X'Z + X'YZ
= XY(1+Z) + X'Z( 1+ Y)
= XY.1 + X'Z . 1
= XY + X'Z = R.HS
(b) 02 marks
F= AB' + CD'
10
A
C
D
Reduced Expression is :-
N + O’M’ + O’P + OP’M
7.
(a) (i) File Transfer Protocol 01 mark
(ii) Voice over Internet Protocol
(b) Server side Scripiting – JSP 01 mark
11
Client side Scripting – Java Script
(ii)
GREEN
BLUE RED
(iv)Optical fibre.
12
f URL Example-www.irctc.co.in/welcome.html 01 mark
Domain name- irctc.co.in (in above URL)
g Twisted pair cable 01 mark
Coaxial cable
Optical fibre
-----------X-------------X---------------------X----------------------------X-----------------X---------
13