(Paper) computer Science Sample Paper Class XII - 2000
Disclaimer: This website is NOT associated with CBSE, for official website of CBSE visit - www.cbse.gov.in
Computer
Science Class-
XII
Sample Paper- Year 2000
Q
. (a)
Illustrate the concept of function overloading with the help of an example?
Q (b) Name the header file, to which following
built-in function belong:
(i) isupper( )
(ii) setw( )
(iii) exp( )
(iv) strcmp( )
Q (c) Will the following program execute
successfully? If not, state the reason(s).
#include<stdio.h>
void main()
{
int s1,s2,num;
s1=s2=0;
for(x=0;x<11;x++)
{
cin<<num; if(num>0) s1+=num; else s2=/num;
}
cout<<s1<<s2;
}
Q (d) Give the output of the following program segment (Assuming all required header files are included in the program):
char *NAME="a ProFiLe";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-1]);
else
NAME[x]--;
cout<<NAME<<endl;
Q (e) Write the output of the following program:
#include<iostream.h>
int func (int &x, int y=10)
{
if(x%y==0) return ++x; else return y--;
} void main()
{
int p=20,q=23;
q=func(p,q);
cout<<p<<q<<endl;
p=func(q);
cout<<p<<q<<endl;
q=func(p);
cout<<p<<q<<endl;
}
Q
(a)
Why is a destructor function required in classes? Illustrate with the help
of an example.
Q (b) Define a class worker with the following specifications:
Private
members of class worker
wno |
integer |
wname |
25characters |
hrwrk,wgrate |
|
totwage |
|
calcwg( ) |
|
|
|
in_data( ) |
A function to accept values for wno, wname,hrwrk,wgrateand invoke calcwg( ) to calculate totpay. |
out_data( ) |
A function to display all the data members on the screen.You should give definitions of functions. |
Q (c)Consider the following and answer the following questions given below:
{
int A;
protected:
int B,C;
public:
void INPUT(int);
void OUTPUT( );
} ;
class Dept:protected School
{
int X,Y;
protected:
void IN(int, int);
public:
void OUT( );
};
class Teacher:public Dept
{
int P;
void DISPLAY(void);
public:
void ENTER( );
};
(i)Name the base class and
derived class of the class Dept.
(ii) Name the data member(s) that can be accessed from function OUT( ).
(iii) Name the private member function(s) of class Teacher.
(iv) Is the member function OUT( ) accessible by the objects of Dept?
Q
.
(a)Suppose A, B, C are arrays of integers of size M, N and M+N respectively. The
members in array A appear in ascending order while the members in array B appear
in descending order. Write a user defined function in C++ to produce third array
C by merging arrays A and B in ascending order. Use A, B and C as arguments in
the function.
Q (b) An array VAL[1……15][1……10] is stored
in the memory with each element requiring 4 bytes of storage. If the base
address of array VAL is 1500, determine the location of VAL[12][9] when the
array VAL is stored (i) Row wise (ii) Column wise.
Q (c) Write a user-defined function in C++ to find
and display the sum of both the diagonal elements of a two dimensional array
MATRIX[6][6] containing integers.
Q (d) Evaluate the following postfix expression
using a stack. Show the contents of stack after execution of each operation:
20, 8, 4, /, 2, 3, +, *, -
(e) Give necessary declaration for a queue containing float type numbers; also
write a user defined function in C++ to insert a float type number in the queue.
You should use linked representation of queue.
Q
(a)Name two member functions of ofstream class.
Q (b) Assuming the class DRINKS defined below, write functions in C++ to perform the following:
(i)Write the objects of
DRINKS to a binary file.
(ii) Read the objects of DRINKS from binary file and display them on screen when
DNAME has value "INDY COLA".
{
int DCODE;
char DNAME[13]; //Name of the drink
int DSIZE; //Size in liters float DPRICE;public:
void getdrinks( )
{cin>>DCODE>>DNAME>>DSIZE>>DPRICE;}
void showdrinks( )
{cout<<DCODE<<DNAME<<DSIZE<<DPRICE<<endl;}
char *getname( ){return DNAME;} };
Q
.
(a) What is the need for normalistion? Define third normal form.
Write SQL commands for (b) to
(e) and write the outputs for (g) on the basis of table CLUB.
Table: CLUB
COACH_ID |
COACHNAME |
AGE |
SPORTS |
DATOFAPP |
PAY |
SEX |
1 |
KUKERJA |
35 |
KARATE |
27/03/1996 |
1000 |
M |
2 |
RAVINA |
34 |
KARATE |
20/01/1998 |
1200 |
F |
3 |
KARAN |
34 |
SQUASH |
19/02/1998 |
2000 |
M |
4 |
TARUN |
33 |
BASKETBALL |
01/01/1998 |
1500 |
M |
5 |
ZUBIN |
36 |
SWIMMING |
12/01/1998 |
750 |
M |
6 |
KETAKI |
36 |
SWIMMING |
24/02/1998 |
800 |
F |
7 |
ANKITA |
39 |
SQUASH |
20/02/1998 |
2200 |
F |
8 |
ZAREEN |
37 |
KARATE |
22/02/1998 |
1100 |
F |
9 |
KUSH |
41 |
SWIMMING |
13/01/1998 |
900 |
M |
10 |
SHAILYA |
37 |
BASKETBALL |
19/02/1998 |
1700 |
M |
Q
(b) To show all the information about the swimming coaches in the club.
Q
(c)To list names of all the coaches with their date of appointment (DATOFAPP) in
descending order.
Q
(d) To isplay a report showing coachname, pay, age, and bonus (15% of pay) for
all the coaches.
Q
(e) To insert a new row in the CLUB table with the following data: 11,
"PRAKASH",37, "SQUASH",{25/02/1998},2500, "M"
Q (f) Give the output of following SQL statements:
(i)Select COUNT (distinct
SPORTS) from CLUB;
(ii) Select MIN(AGE) from CLUB where SEX="F";
(iii) Select AVG(PAY) from CLUB where SPORTS="KARATE";
(iv) Select SUM(PAY) from CLUB where DATOFAPP>(31/01/98);
Q (g)Assume that there is one more table COACHES in the database as shown below:
SPORTS PERSON | SEX | COACH_NO |
AJAY | M | 1 |
SEEMA | F | 2 |
VINOD | M | 1 |
TANEJA | F | 3 |
What will be the output of
the following query: SELECT SPORTS PERSON, COACHNAME
FROM CLUB, COACHES
WHERE COACH_ID=COACH_NO;
Q
.
(a)State Absorption Laws. Verify one of the Absorption Laws using a truth table.
Q
(b) Prove X’.Y+Y’.Z=X’.Y.Z+X’.Y’.Z’+X.Y’.Z+X’.Y’.Z
algebraically.
Q
(c) Obtain simplified form for a boolean expression
F(x,y,z,w)= å(1,3,4,5,7,9,11,12,13,15) using Karnaugh Map.
Q
(d) Draw the logic circuit for a half adder.
Q
(e) Represent the Boolean expression X’Y+Y’Z with the help of NAND gates
only.
Q (f) Write the Sum of Products form of the function G(U,V,W). Truth table representation of G is as follows:
U | V | W | G |
0 | 0 | 0 | 0 |
0 | 0 | 1 | 0 |
0 | 1 | 0 | 1 |
0 | 1 | 1 | 1 |
1 | 0 | 0 | 1 |
1 | 0 | 1 | 0 |
1 | 1 | 0 | 0 |
1 | 1 | 1 | 1 |
Q
(a) What are Routers?
Q
(b)
What is the purpose of using a Modem?
Q
(c) Write two advantages and two disadvantages of Bus Topology in network.
Q
(d) What is the difference between LAN and WAN?