CBSE Set Q Computer Science Class XII 1998 Sample Test Papers For Class 12th for students online
Computer
Science Class XII (CBSE)
You are on questions
Q no. 1 (a) Define the following
terms: (i) Inheritance (ii) Encapsulation.
Q no. 1 (b) Name the header files, to which the
following built-in-functions belong to:
(i) cos() (ii) setw() (iii) toupper() (iv) strcpy()
Q no. 1 (c) Find the syntax error(s), if any, in the following program:
include
void main( )
{
int R;W=90;
while W60
{
R=W-50;
switch(W)
{
20: cout<<"Lower
Range"<<endl;
30: cout<<"Middle
Range"<<endl;
40: cout<<"Higher
Range"<<endl;
}
}
}
Q no. 1 (d) Give the output of the following
program segment:
char *NAME="IntRAneT";
for(int x=0;x<strlen(NAME); x++)
if(islower(NAME[x]) )
NAME [ x] = toupper ( NAME [x]);
else
if(isupper(NAME [x] ) )
if( x%2==0)
NAME [x] = tolower
( NAME [x] );
else
Name [x]
= NAME [ x - 1 ];
puts(NAME);
Q no. 1 (e) Write the output of the following program:
#include <iostream.h
void Execute(int &X, int Y=200)
{
int TEMP=X+Y;
X+=TEMP;
if (Y!=200)
cout<<TEMP<<X<<Y<<endl;
}
void main ( )
{
int A=50, B=20;
Execute (B);
cout<< A<<B<<endl;
Execute( A, B);
cout <<A<<B<<endl;
}
Q no. 1 ( f ) Write a C++ function having two value parameters X and N with
result type float to find the sum of series given
below:
Q no. 2 (a) What is a copy constructor? What
do you understand by constructor overloading?
Q no. 2
(b) Define a class student with the following specifications:
|
|
admno sname eng, math, science total ctotal() |
integer |
public member functions of class student |
|
Takedata() |
function to accept values for admno,
sname, eng, math, science and invoke ctotal to calculate total. |
Q no. 2 (c) Consider the following declarations and answer the questions given below: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
class PPP { |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
int H; class QQQ: private PPP (i) Name the base class and derived class
of the class QQQ.
Q no. 3 (a) Suppose an array P containing
float is arranged in ascending order. Write a user defined function in
C++ to search for one float from P with the help of binary search
method. The function should return an integer 0 to show absence of the
number and integer 1 to show presence of the number in the array. The
function should have the parameters as (1) an array P (2) the number
DATA to be searched (3) number of elements N. Q no. 4 (b) Assuming the class EMPLOYEE
given below, write functions in C++ to perform the following: Q No.5 (a) What is a relation? What is
the difference between a tuple and an attribute?
(b) To select all the information of
patients of cardiology department.
Q No. 7 (a) What are repeaters? |