Está en la página 1de 9

KENDRIYA VIDYALAYA NO.

1 NAUSENABAUGH,
VSKP-05
1st Pre-Board Exam -2014
CLASS XII - COMPUTER SCIENCE (083)
Time allowed: 3 hours

Maximum Marks:
70
Instructions:

(i) All questions are compulsory. (ii) Programming language: C++,


SQL.

MARKING SCHEME

1.(a) Ans. It is also called non-graphical character constant. These constants are used for some special
purpose in C++ programming . These constants are used for some special purpose in C++
programming. These constants will not give any impression on screen, but these act at run-time of
programme. These constants are enclosed in a single quotation followed by by back-slash.
Some commonly used non-graphical constants are given as follows :
\n Newline
\t Tab
\a Beep sound
\0 Null pointer
\f form feed
\r Carriage return
(2 Marks for correct explanation with example)
(b)

iomanip.h
iostream.h
(1/2 Mark for each correct answer)
(c )
Correction 1 : In Line 1 include file name should enclosed with either < > or
Correction 2 : In Line 2 all the data items of array must be enclosed within
{ and }.
Correction 3 : In Line 3 variable COUNT should have Data type.
Correction 4 : In Line 6 insertion operator << should be used instead of <
(1/2 marks for each correction , any 4 corrections should be correct to get full
marks)
(d)
Object Created Successfully
Object Created Successfully
Object Destroyed Successfully
100: VARANASI TO VIZAG
Object Destroyed Successfully
(1 mark for correctly displaying constructor message and 1 mark for destructor message display)
1 | Page

(e)
50 240
290 340 240
340 240
(1 mark for each line of correct output and full marks 3 if all are correct)
(f)Answer :
VIZAG@@KANPUR@@KANPUR
VIZAG @@ KANPUR @@VIZAG
(2 Marks for correct answer)
2.(a) 1 Mark for correct definition of copy constructor. 1 mark for constructor overloading.
(b)
@@@@
91827
OR
No Output as L is not declared in void Print (int N) Polymorphism
OR
Function Overloading
( Mark for writing each correct line of output)
(1 Mark for writing the feature name correctly)
(C )
class train
{
int Tno,Distance,No_of_psgr;
float fare,amt;
char src[20],dest[20];
void getdetails()
{
cout<<"\n enter train no";
cin>>Tno;
cout<<"\n enter distance";
cin>>Distance;
cout<<"\n enter no of passenger";
cin>>No_of_psgr;
}
void showdetails()
{
cout<<"\n train no"<<Tno<<endl;
cout<<"\n distance"<<Distance<<endl;
cout<<"\n no of passenger"<<No_of_psgr<<endl ;
calc_fare();
cout<<"\n amount "<<fare;
}
void calc_fare()
{
if(Distance>2000)
fare=10*Distance;
2 | Page

else if(Distance>1500)
fare=15*Distance;
else if(Distance>1000)
fare=18* Distance ;
else
fare=20*Distance;
}
};
( Mark for correct syntax for class train)
( Mark for correct declaration of data members)
(1 Mark for correct definition of getdetails())
(1 Mark for correct definition of showdetails() with proper invocation of calc_fare()
function)
(1 Mark for correct definition of calc_fare()
NOTE:
Deduct Mark to be deducted if calc_fare() is not invoked properly inside
showdetails() function
No marks to be deducted if member function definitions are written inside the
class
(d)
i
ii
iii
iv

Multi Level Inheritance


readtextbook() and showtextbook()
readphysicsbook(), showphysicsbook(), readtextbook() and showtextbook()
The size of object of physicsbook= size of book + size of Textbook + size of
physicsbook.
= 42+6+20 = 68 bytes
(1 Mark for each correct answer)
Note: No marks to be awarded for any other alternative answer Constructor functions to
be ignored

3(a )
Ans

void COMBINE(int A3[],int A1[],int A2[],int N,int M )


{
for(int I=0,J=0,K=0;i<N+M; I++)
if (I%2==0)
A3[I]=A1[J++];
else
A3[I]=A2[K++];
}
OR
void COMBINE(int A3[],int A1[],int A2[],
int N, int M)
{
int J=0,K=0;
for(int I=0;i<N+M; I++)
{
if (I%2==0)
{
A3 [I] =A1 [J] ;
3 | Page

J++;
}
else
{
A3[I]=A2[K]; K++;
}}
}
(1 Mark for correct loop)
( Mark for checking even locations)
( Mark for checking even locations or writing else for odd locations) ( 1 Mark for
incrementing A1 and A2 Array Locations)
(b) Ans

Assuminq LBR=LBC=0
B=5200
W=4 bytes
Number of Rows(N)=20
Number of Columns(M)=50
LOC(Arr[I] [J])
= B +(I + J*N)*W
LOC(Arr[15][10]) = 5200+(15+10*20)*4
= 5200 + (215*4)
= 5200 + 860
= 6060
(1 Mark for writing correct formula (for row major) OR substituting formula with
correct values for calculating Address)
(2 marks for calculating correct address) Note:
1 Mark to be awarded for writing only the correct answer (i.e. 6060)
(c)
Ans
class Queue
{
NODE *Front, *Rear;
public:
Queue ( ) {Front = NULL; Rear = NULL; } void QueInsert ( ) ;
void QueDel ( ) ;
void QueDis ( ) ;
~Queue ( ) ;
};
void Queue: : QueInsert ( )
{
NODE*Temp=new NODE;
cin>>Temp->Bno; gets (Temp->Bname) ; Temp->Link = NULL;
Rear->Link = Temp;
Rear = Temp ;
}
(1 Mark for creating a new NODE dynamically)
(1 Mark for assigning NULL to Link of new NODE)
(1 Mark for linking the Rearmost NODE to the new NODE)
(1 Mark for making the new NODE as the Rearmost NODE)
(d)
4 | Page

( Mark for writing correct outer loop)


( Mark tor writing correct inner loop)
( Mark for correctly shifting the elements)
(1/2 Marks for correct function prototype )
Note : Focus should be on the logic of insertion sort ..Some minor coding error
might be ignored

(e )
Symbol scanned from
infix

Stack status ( bold


letter shows the top of
the stack)
(
((
((
((+
((+
(
(*
(*(
(*(
(*((*((*
(/
(/

Postfix expression

(
A
A
+
A
B
AB
)
AB+
*
AB+
(
AB+
C
AB+C
AB+C
D
AB+CD
)
AB+CD/
AB+CD-*
E
AB+CD-*E
)
AB+CD-*E/
The equivalent Postfix expression of (A+B)*(C-D)/E is AB+CD-*E/
(2 Mark for getting the correct final answer) Note:
( Mark for writing only the final answer without showing the
operations or Stack and intermediate steps involved in conversion)
4(a)
Ans Option 1
Statement 1:
File. tellp ( ) ;
OR
File.tellg ( ) ;
Statement 2:
File.seekp (FilePos - sizeof (MAGAZINE)) ;
OR
File.seekp (-sizeof (MAGAZINE), ios: :cur));
OR
File.seekg (FilePos - sizeof (MAGAZINE));
OR
File.seekg (-sizeof (MAGAZINE), ios: :cur));
Option 2
Statement 1:
File.tellp ( ) - sizeof (MAGAZINE) ;
OR
File.tellg ( ) - sizeof (MAGAZINE) ;
Statement 2:
File. seekp (FilePos) ;
OR
File.seekg (FilePos) ;
( Mark for writing Statement 1 correctly)
( Mark for writing Statement 2 correctly)
Note:
5 | Page

File / Fil both are acceptable as the name of the File object
(b)
Ans void COUNT ( )
{
ifstream Fil ("QUOTES. TXT") ;
char STR [10] ;
int count = 0 ;
while (!Fil.eof ( ))
{
Fil>>STR;
if (strcmpi (STR, "You")==0 | | strcmpi (STR, "Your") ==0)
count++;
}
Cout<<"Count of You/Your in file : "<<count<<endl; Fil.close( ) ; //Ignore
}
OR
Any other correct function definition performing the desired operation ( Mark for
opening QUOTES. TXT correctly)
( Mark for reading each word (Whichever method adopted) from, the file)
( Mark for comparing the word with You and Your and incrementing
counter)
( Mark for displaying the number of You/Your with/without the Text
Message)
NOTE:
Ignore case sensitivity check for You/Your
(c )
Ans void Search( )
{
COMPUTER L;
long modelnum;
cin>>modelnum;
ifstream fin;
fin.open ("COMPUTER.DAT", ios: :binary | ios: :in);
while(fin.read ((char*) &L,sizeof (L)))
{
if (L.ReturnModelNo ( ) == modelnum)
L.StockDisplay ( ) ;
}
Fin.close() ; //Ignore
}
OR
void Search (long modelnum)
{
COMPUTER L;
ifstream fin;
fin.open ("COMPUTER.DAT", ios: :binary | ios: :in) ;
while (fin.read ((char*) &L,sizeof (L)))
{
if (L.ReturnModelNo ( ) == modelnum)
L.StockDisplay ( ) ;
}
6 | Page

fin.close ( ) ; //Ignore
}
( Mark for declaring and entering a model number for a COMPUTER to search
OR passing it as a parameter to the function)
( Mark for opening COMPUTER.DAT correctly)
( Mark for reading each record from COMPUTER.DAT) ( Mark for correct loop /
checking end of file)
( Mark for comparing value returned by ReturnModelNo() with model number
entered)
( Mark for displaying the matching record)
5.(a )
(1 Mark for explaining Foreign Key correctly)
(1 Mark for explaining Degree correctly)
(b)
(i) SELECT FIRSTNAME ,LASTNAME FROM WORKERS WHERE ((LASTNAME LIKE '%TA%')
OR (LASTNAME LIKE '%RE%') OR (LASTNAME LIKE '%NA%'));
(ii) SELECT FIRSTNAME ,LASTNAME,ADDRESS FROM WORKERS , DESIG ORDER BY SAL
DESC;
(iii) SELECT DESIGNATION , AVG(SALARY) FROM DESIG GROUP BY DESIGNATION
HAVING COUNT(*) >3;
(iv) SELECT FIRSTNAME , DESIGNATION FROM WORKERS , DESIG WHERE SALARY
BETWEEN 40000 AND 70000 ;
(1 Mark for each correct query)
( Mark for each partially correct answer)
(v)
SELECT FIRSTNAME, SALARY FROM WORKERS, DESIG WHERE DESIGNATION =
Manager AND WORKERS.W_ID = DESIG.W_ID ;
FIRSTNAME SALARY
Sam
75000
Manila
70000
George
75000
(vi) SELECT COUNT(DISTINCT DESIGNATION) FROM DESIG;
COUNT(DISTINCT DESIGNATION)
3
(vii) SELECT W_ID, SALARY+BENEFITS FROM DESIG
WHERE DESIGNATION IN ( 'Manager, Clerk) ;
W_ID
SALARY+BENEFITS
102
90000
144
85000
210
87500
255
62000
300
55000
(viii) SELECT SUM(BENEFITS) FROM DESIG WHERE DESIGNATION = Clerk;
SUM(BENEFITS)
22000
( Mark for each correct output)
6(a)
Ans
U
7 | Page

U'

U'+V

U.

U+V

(U'+V)
0
0
0
1

0
0
1
1
0
0
1
1
1
1
1
0
0
0
1
1
1
0
1
1
VERIFIED FALSE
(2 Marks to be awarded if Truth Table is made OR any equivalent term conveying
the same meaning)
(b) Ans
F= A B + AB +A B
(2 Marks for the final expression A B + AB +A B
OR
(1 Mark for anyone of the correct terms out of A B or AB or A B
(c )
Ans
F(A,B,C) = (A+B+C).(A+B'+C').(A'+B+C').(A'+B'+C)
(1 Mark for the correct POS form)
Note: Deduct mark if wrong variable names are used
(d)
Ans F(U,V,W,Z)= V + U W +UWZ
One Octet (4,5,6,7,12,13,14,15) reduces to V
One Quad(0,1,4,5) reduces to U W
One Pair(11,15) reduces to UWZ
( 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) 1. Marks for correct definition
A protocol means the rules that are applicable for a network.
It defines the standardized format for data packets, techniques for detecting and
correcting errors and so on.
A protocol is a formal description of message formats and the rules that two or
more machines must follow to exchange those messages.
E.g. using library books.
Types of protocols are:
1. HTTP
FTP
TCP/IP
SLIP/PPP
(b) marks for each difference (c) 1 marks for correct definition
(d) 1 marks for correct definition
(e)
(i) 1marks for correct layout
(ii) 1 marks for writing the name of correct place (Admin Section)
(iii) marks for correct placement of switch and marks for correct placement
of repeater
(iv) 1 marks for writing the correct answer (MAN)
(f) A Gateway is a network device that connects dissimilar networks. It
established an intelligent connection between a local area network and external
networks with completely different structures. (1 marks for correct definition)
(g) RJ- 45 - RJ-45 is short for Registered Jack-45
NIC - network interface card
8 | Page

(1/2 mark for each correct expansion)


-----------------------------------------------------------------------------

9 | Page

También podría gustarte