Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword or section
Like this
3Activity
P. 1
MARKING SCHEME 2007 - Computer Science

MARKING SCHEME 2007 - Computer Science

Ratings: (0)|Views: 119 |Likes:
Published by jamna vyas

More info:

Published by: jamna vyas on Sep 14, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

05/09/2014

pdf

text

original

 
261
COMPUTER SCIENCE
Time allowed : 3 hoursMaximum marks: 70General Instructions
:(i)
 All 
questions are compulsory.(ii)Programming Language : C++
QUESTION PAPER CODE 911.
(a)Differentiate between a Logical Error and Syntax Error. Also give suitableexamples of each in C++.2(b)Name the header file(s) that shall be needed for successful compilation of the following C++ code :1
void main( ){char Text[40];strcpy(Text,”AISSCE”);puts(Text);}
(c)Rewrite the following program after removing the syntactical error(s),if any. Underline each correction.2
#include <iostream.h>const int
 
Size 5;void main(){int Array[Size];Array = {50,40,30,20,10};for(Ctr=0; Ctr<Size; Ctr++)cout>>Array[Ctr];}
(d)Find the output of the following program :2
#include<iostream.h>void main(){int Numbers[] = {2,4,8,10};
 
262
int *ptr = Numbers;for (int C = 0; C<3; C++){cout<< *ptr << “@”;ptr++;}cout<<endl;for(C = 0; C<4; C++){(*ptr)*=2;--ptr;}for(C = 0; C<4; C++)cout<< Numbers [C]<< “#”;cout<<endl;}
(e)Find the output of the following program :3
#include<iostream.h>void Indirect(int Temp=20){for (int 1=10; I<=Temp; I+=5)cout<<I<<” , “ ;cout<<endl;}void Direct (int &Num){Num+=10;Indirect(Num);}void main(){int Number=20;Direct(Number) ;Indirect();cout<< “ Number=” <<Number<<endl ;}
 
263
(f)In the following C++ program what is the expected value of Myscore fromOptions (i) to (iv) given below. Justify your answer.2
#include<stdlib.h>#include<iostream.h>void main( ){randomize();int Score[] = {25,20,34,56, 72, 63}, Myscore;Myscore = Score[2 + random(2)];cout<<Myscore<<endl; }
(i)25(ii)34(iii)20(iv)None of the above
2.
(a)Differentiate between Protected and Private members of a class incontext of Inheritance using C++.2(b)Answer the questions (i) and (ii) after going through the following class:2
class Science{char Topic[20];int Weightage;public:Science ( ) //Function 1{strcpy (Topic, “Optics” );Weightage = 30;cout<<“Topic Activated”;}~Science( ) //Function 2{cout’<<”Topic Deactivated”;}
(i)Name the specific features of class shown by Function 1 and Function2 in the above example.(ii)How would Function 1 and Function 2 get executed ?

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->