Upload
santhosh-siva-kumar
View
218
Download
0
Embed Size (px)
Citation preview
8/10/2019 CS PrebBoard I2010
1/12
Kendriya Vidyalya Sangathan, Chennai Region
First Common Pre- Board Examination 2010-11
Computer Science/Scoring Key/Marking Scheme
(a) Define function overloading. 1 mark
Implements polymorphism or any other correct point mark
Correct example mark
(b)iostream.h! and math.h! mark each
(c) mark for each correct identification and correction
"include iostream.h!
class #$#%$&
'
int #nofloat ees
public*
void &egister()
'cin!!#no!!ees+void Display()
'cout#no,*,eesendl
+
+
void main()
'
#$#%$& # #.&egister() #.Display()
+
( Mark each correction)
(d) 1-1*/1--*0/1-*23
(1 Mark for each correct line of output)
8/10/2019 CS PrebBoard I2010
2/12
(e) 3 3 1/ / 1-/
(2 Marks for correct line of output)
(f) (i) 4%%C
(2 Marks for mentioning correct option)-.
(a) 5hen a sub class inherits from more than one base class it
is kno6n asmultiple inheritance.
5hen a sub class inherits from multiple base class and all its
base class inherit from single base class it is kno6n as
hybrid inheritance.
#ultiple Inheritance
7ybrid inheritance
(18- mark each for correct definition or diagram)
(18- marks each for the appropriate example)
(b) (i) unction 1 is kno6n as default constructor. It is
invoked 6hen the ob9ect of class gets into scope.
( Mark for mentioning constructor)
( Mark for remaining answer)
(ii) :olymorphism 8 Constructor ;verloading8unction
;verloading
8/10/2019 CS PrebBoard I2010
3/12
int playcode
char
playtitle?-3@
float duration
int noofscenes
public *
:=4> ( )
'
duration A B3
noofscenes A
3
+
e6play ( )
'
cin!!playcode
cin !!
playtitle
+
#oreinfo(float dE int ns )
'
duration A d
noofscenes A
ns
+
8/10/2019 CS PrebBoard I2010
4/12
( Mark for correct syntax for class header)
( Mark for correct declarations of
data members)
(1/2 Mark for appropriate definition ofconstructor)
(1/2 Mark each for appropriate definition of Newplay
( ) and !howplay ( ) )
(1/2 mark for correct definition of
Moreinfo( ))
(1 mark for correct definition of
destructor)
(d) (i) Constructor * 5;&=D J! 4HI; J!
8/10/2019 CS PrebBoard I2010
5/12
( Mark for correct "unction #eader)
( Mark for correct initiali$ation of re%uired &ariables)
( Mark for correct formation of loop)
( Mark for appropriate conditions and assignments in the
loop)( Mark for appropriately transferring the remaining
elements from first array)
( Mark for appropriately transferring the remaining
elements from second array)
(b) 4n array
8/10/2019 CS PrebBoard I2010
6/12
;D$ Qtop A K==
void insert (char name )
'
;D$ Qne6ptr
ne6ptr A ne6 ;D$strcpy(ne6ptrJ!stunameEname)
ne6ptrJ!next A K==
if (Sne6ptr)
'
cout GKnable to create node. #emory full
exit (/)
+
if (top AA K==)
'
top A ne6ptr
+
else
'
ne6ptr J! next A top
top A ne6ptr
+
+
(1 Mark for creating a new node and assigning/entering
appropriate &alues in it)
(1 Mark for checking if stack is full)
(1 Mark for assigning top* if stack is +mpty)
(1 Mark for assigning top if stack has atleast one node
present )
(d) void diagonalavg(int a?1/@?1/@E int n)
'
int iE9EsumA/Ecommon float avg
for(iA/iniOO)
8/10/2019 CS PrebBoard I2010
7/12
for (9A/9n9OO)
'
if (iAA9)
sum A sum O a?i@?9@
if (iO9 AA n) sum A sum O a?i@?9@
if ((iAA9)NN(iO9AAn))
common A a?i@?9@
+
sum A sum R common
avg A (float) sum8(nJ1)
cout avg
+
( Mark for correct function header)
( Mark for appropriate loop)
( Mark for correct expression for adding each diagonal
elements and finding a&erage)
( Mark for taking care of common element)
(e) -/E /E OE 3/E B/E J EQ
8/10/2019 CS PrebBoard I2010
8/12
( Mark for each correct !tatement)
(b) 5rite a function in COO to average length of 6ord in a text
file ,.HVH,.
void avg6ord()
'ifstream fin
int lsum A/EcountA/
float avg
fin.open(G.HVH)
6hile (S fin.eof())
'
fin.getline(strE-/EW W)
count OO
lsum A lsum O strlen(str)
+
avg A (float)lsum8count
cout avg
fin.close()
+
( Mark for opening !,-.,, correctly)
( Mark for initiali$ing a counter &ariable as 0)
( Mark for correctly reading a line from the file)
( Mark for correctly incrementing the counter)
(c) void %ook
8/10/2019 CS PrebBoard I2010
9/12
( Mark for reading each record from .34,)
( Mark for correct loop / checking end of file)
( 1 Mark for comparing ook number)
( Mark for displaying the matching record)
3.(a) Degree* umber of Columns in a table
-
Cardinality* umber of ro6s in a table
(1 Mark for each definition)
(b) (i) 57$&$
>$4&(7I&$D4H$) A 122T
(1 Mark for correct %uery)
;&
( Mark for partially correct answer)
(ii) K:D4H$ C;K&
8/10/2019 CS PrebBoard I2010
10/12
( Mark for correct output)
(&iii) 627 107
( Mark for correct output)
T.
(a) (4O%)W A 4W.%W
4 % (4O%) (4O%)W 4W %W 4W.%W
/ / / 1 1 1 1
/ 1 1 / 1 / /
1 / 1 / / 1 /
1 1 1 / / / /
(1 Mark for stating any one of the 3emorgan8s 9aw)
(1 Mark for &erifying the law)
(b)
(1 mark for correct diagram)
(c) (4E%EC)A(4OC)W.(4O%)W.(%OC)W
(1 Marks for the final expression )
(d) "(:-:;) < ( = - = ;).( = y8 = ;).(8 = y = ;8).(8 = -8 =
;)
(1 Marks for the final expression )
(d) (4E%ECED)A4WCWO4WDWO%WDW
( Mark for placing all 1s at correct positions in *Map)
( Mark for each grouping)
(1 Mark for writing final expression in reduced/minimal form)
ote* Deduct mark if 6rong variable names are used
.(a) 4ppropriate comparison bet6een #essage
8/10/2019 CS PrebBoard I2010
11/12
8/10/2019 CS PrebBoard I2010
12/12
(1 #ark for correct ans6er)
(ii) $7&K block is suitable place for server as it has
maximum number of computers.( mark for correct location of server)
( mark for correct reason)
(iii) 7ub8