You are on page 1of 12

KendriyaVidyalyaSangathan,ChennaiRegion

FirstCommonPreBoardExamination201011
ComputerScience/ScoringKey/MarkingScheme
(a)

Define function overloading.

1 mark

Implements polymorphism or any other correct point mark


Correct example
(b)<iostream.h>
(c)

and <math.h>

mark
mark each

mark for each correct identification and correction

#include <iostream.h>
class MEMBER
{
int Mno;float Fees;
public:
void Register()
{cin>>Mno>>Fees;}
void Display()
{cout<<Mno<<":"<<Fees<<endl;
}
}
;
void main()
{
MEMBER M; M.Register(); M.Display();
}
( Mark each correction)
(d)
(1

121:70
122:80
123:95
Mark for each correct line of output)

(e)

5 5 10 30 120
(2 Marks for correct line of output)

(f)

(i) ABBC
(2 Marks for mentioning correct option)

2.
(a)

When a sub class inherits from more than one base class it

is known as multiple inheritance.


When a sub class inherits from multiple base class and all its
base class inherit from single

base class it is known as

hybrid inheritance.

Multiple Inheritance
Hybrid inheritance
(1/2 mark

each for correct definition or diagram)

(1/2 marks each for the appropriate example)


(b)

(i) Function 1 is known as default constructor.

invoked when the object of class gets

It is

into scope.

( Mark for mentioning constructor)


( Mark for remaining answer)
(ii) Polymorphism / Constructor Overloading/Function
Overloading
Seminar S2(90);

//Function 3

( Mark for mentioning the correct concept)


( Mark for the example)
(c)

class PLAY

int playcode;
char
playtitle[25];
float duration;
int noofscenes;
public :
PLAY ( )
{
duration = 45;
noofscenes =
5;
}
New_play ( )
{
cin>>playcode;
cin >>
playtitle;

}
More_info(float d, int ns )
{
duration = d;
noofscenes =
ns;
}
Show_play( )
{
cout <<
playcode<<playtitle<<duration<<noofscenes;
}
~ PLAY ( )
{
cout << The play is over;
}

};

( Mark for correct syntax for class header)


( Mark for correct declarations of
data members)
(1/2 Mark for appropriate definition of
constructor)
(1/2 Mark each for appropriate definition of
( )

New_play

and Show_play ( ) )

(1/2 mark for correct definition of


More_info( ))
(1 mark for correct definition of
destructor)
(d)

(i)

Constructor : WORLD -> NATION -> STATE


Destructor :

(ii)

STATE -> NATION -> WORLD

Data Members : M, U

(iii) Member Functions : DISPLAY ( ), INDATA ( ), OUTDATA ( )


(iv)

No. It will not be accessible.

3.
(a)

void MergeArray(int A[ ],int B[ ],int C[ ],int N,int M)


{
int I=0,J=0;
int K=0;
while (I<N && J<M)
{
if (A[I]<B[J])
C[K++]=A[I++];
else
if (A[I]>B[J])
C[K++]=B[J++];
else
{
C[K++]=A[I++];
J++;
} }
for (;I<N;I++)
C[K++]=A[I];
for (;J<M;J++)
C[K++]=B[J];
}

( Mark for correct Function Header)


( Mark for correct initialization of required variables)
( 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)

An array S[40][40] is stored in the memory along the row

with each of the element occupying 4 bytes, find out the memory
location for the element S[20][10], if the

Base Address of the

array is 5000.
Given
No of columns = 40
w= 4
B = 5000
Addr of ele i,j = B + w((i-ic) * c + (j-jc))
= 5000 + 4((20-0) * 40 + (10 0))
= 8240
(1 Mark for writing correct formula (for column major) OR
substituting formula with
correct values)
(1 Mark for writing calculation step - at least one step)
(1 Mark for correct address)
c)

Write a function in C++ to perform insert operation in a

dynamically allocated stack containing names of students.


struct NODE
{
char stu_name[30];
NODE *next;
};

NODE *top = NULL;


void insert (char name )
{
NODE *newptr;
newptr = new NODE;
strcpy(newptr->stu_name,name);
newptr->next = NULL;
if (!newptr)
{
cout << Unable to create node. Memory full;
exit (0);
}
if (top == NULL)
{
top = newptr;
}
else
{
newptr -> next = top;
top = newptr;
}
}
(1 Mark for creating a new node and assigning/entering
appropriate values in it)
(1 Mark for checking if stack is full)
(1 Mark for assigning top- if stack is Empty)
(1 Mark for assigning top if stack has atleast one node
present )
(d)

void diagonalavg(int a[10][10], int n)


{
int i,j,sum=0,common;
float avg;
for(i=0;i<n;i++)

for (j=0;j<n;j++)
{
if (i==j)
sum = sum + a[i][j];
if (i+j == n)
sum = sum + a[i][j];
if ((i==j)&&(i+j==n))
common = a[i][j];
}
sum = sum common;
avg = (float) sum/(n-1);
cout << avg;
}
( Mark for correct function header)
( Mark for appropriate loop)
( Mark for correct expression for adding each diagonal
elements and finding average)
( Mark for taking care of common element)
(e)

20, 30, +, 50, 40, - ,*


Step

Symbol

Stack

20 Push

20

30 Push

20

+ Pop 2
elements

50

50 Push

50 50

40 Push

50 50 40

- Pop 2
elements

50 10

Intermediate
Calculations
30
20 + 30

50 40

* Pop 2
500
50 * 10
elements
( Mark for correctly evaluating each operator)
( Mark for the correct result)

4.
(a) fin.seekp(-1*sizeof(ex),ios::cur);
fin.write((char *)&ex, sizeof(ex));

( Mark for each correct Statement)


(b)

Write a function in C++ to average length of word in a text

file "STORY.TXT".
void avgword()
{
ifstream fin;
int lsum =0,count=0;
float avg;
fin.open(STORY.TXT);
while (! fin.eof())
{
fin.getline(str,20,' ');
count ++;
lsum = lsum + strlen(str);
}
avg = (float)lsum/count;
cout << avg;
fin.close();
}
( Mark for opening STORY.TXT correctly)
( Mark for initializing a counter variable as 0)
( Mark for correctly reading a line from the file)
( Mark for correctly incrementing the counter)
(c)

void BookSearch()
{
fstream FIL;
FIL.open("BOOK.DAT",ios::binary|ios::in);
BOOK B;
int bn,Found=0;
cout<<"Enter Book No. to search"; cin>>bn;
while (FIL.read((char*)&S,sizeof(S)))
if (FIL.RBno()==bn)
{
S.Display();
Found++;
}
if (Found==0) cout<<"Sorry! Book not found!!!"<<endl;
FIL.close();
}
( Mark for opening BOOK.DAT correctly)

( Mark for reading each record from BOOK.DAT)


( Mark for correct loop / checking end of file)
( 1 Mark for comparing Book number)
( Mark for displaying the matching record)
5.
(a)

Degree: Number of Columns in a table


2
Cardinality: Number of rows in a table
(1 Mark for each definition)

(b)

(i)

SELECT FNAME,LNAME FROM FACULTY WHERE

YEAR(HIRE_DATE)

= 1996;
(1 Mark for correct query)
OR

( Mark for partially correct answer)


(ii)
=

UPDATE COURSES SET FEE = FEE*0.1 + FEE WHERE CNAME

'Computer Security';
(1 Mark for correct query)
OR
( Mark for partially correct answer)
(iii)

SELECT MAX(FEE) FROM FACULTY, COURSES WHERE

COURSES.F_ID =FACULTY.F_ID AND FNAME = 'Amit';


(1 Mark for correct query)
OR
( Mark for partially correct answer)
(iv)
SELECT F_ID, HIRE_DATE, SALARY FROM FACULTY WHERE
FNAME LIKE 'S%';
(1 Mark for correct query)
OR
(v)

( Mark for partially correct answer)


5
( Mark for correct output)

(vi) 20000
( Mark for correct output)
(vii)

Grid Computing
Computer Security
Computer Network

( Mark for correct output)


(viii)

C27

107

( Mark for correct output)


6.
(a)

(A+B)' = A'.B'

(A+B)

(A+B)'

A'

B'

A'.B'

(1 Mark for stating any one of the Demorgan's Law)


(1 Mark for verifying the law)
(b)

(1 mark for correct diagram)


(c)

F(A,B,C)=(A+C)'.(A+B)'.(B+C)'
(1 Marks for the final expression )

(d)

F(X,Y,Z) = (X + Y + Z).(X + y' + Z).(X' + y + Z').(X' + Y' +

Z)
(1 Marks for the final expression )
(d)

F(A,B,C,D)=A'C'+A'D'+B'D'
( Mark for placing all 1s at correct positions in K-Map)
( Mark for each grouping)
(1 Mark for writing final expression in reduced/minimal form)
Note: Deduct mark if wrong variable names are used

7.
(a) Appropriate comparison between Message Switching, Packet

Switching.
(1 Mark for writing Appropriate comparison between the
two switching technique)
(b)

iii) ASP and (iv) PHP are not client side scripts

1
(1 Mark for correct answer)
(c) Cyber law is term which refers to all the legal and
regulatory

aspects of internet and the WWW.

(1 Mark for correct answer)


(d)

An Internet Protocol (IP) address is a numerical

identification and logical address that is assigned to devices


connected in a computer network.
An IP Address is used to uniquely identify devices on the Internet
and so one can quickly know the location of the system in the
network.
( Mark for meaning of IP Address)
( Mark for mentioning the usefulness in network security)
(e)
(i) Any appropriate topology. Mesh or Bus
Layout 1
TAGORE

RAMAN

NEHRU

GANDHI

Layout 2
TAGORE

RAMAN

NEHRU

GANDHI

(1 Mark for correct answer)


(ii) NEHRU block is suitable place for server as it has
maximum number of computers.
( mark for correct location of server)
( mark for correct reason)
(iii) Hub/Switch would be placed in every location.
((1 Mark for correct answer)
(iv)

Broadband would be most economical technology to

provide Internet accessibility.


(1 Mark for correct answer)
(f)

Spam mails, also known as junk e-mail, is a subset of spam

that involves nearly identical messages sent to numerous


recipients by e-mail. We can protect our mailbox from spams by
creating appropriate filters.
( Mark for the definition of Spam Mails)
( Mark for the appropriate suggestion for protecting mailbox
from it)
(g)

Free distribution

Source code availability

Derived work

No discrimination against persons or groups

Any two correct criteria.


( mark each)

You might also like