Guess Paper Computer Science (Set-3)

  CBSE You are here

COMPUTER SCIENCE (THEORY)

CLASS – XII

TIME: 3 HOURS                                                                MAX MARKS: 70

General instructions:-

1.There are 7 questions and all questions are compulsory.

2.Marks for each question are indicated against it.

1.a) What is object oriented programming? How is it different from procedural programming? (2)

b) Name the header files to which following built-in functions belong to: (2)

i) cos() ii) setw() iii) toupper() iv) strcpy()

c) Rewrite the following program after removing the syntactical errors (if any). Underline each correction. j (2)

# include [iostream.h]

class payitnow

{ int charge;

Public:

void raise()

{ cin>>charge; }

void show()

{ cout<

};

void main()

{ payitnow P;

p.raise();

show();

}

d) Find the output of the following program: (2)

# include

void X(int &A, int &B)

{ A=A+B;

B=A-B;

A=A-B;

}

void main()

{ int a=4, b=18;

X(a,b);

Cout<< a <<” , ” <

}

e) Write the output of the following program; (2)

# include

# include

void execute(int &X, int Y=200)

{ int TEMP=X+Y;

X=X+TEMP;

If(Y!=200)

{ cout<<<<

}

void main()

I { int A=50, B=20;

execute(B);

cout<<<

execute(A,B);

cout<<<

}

2.a) Write a function sum( ) in C++ with two arguments int x and int n. The function should return a value of type int and it should find the sum of the following series:

(4)

b) Define a class report with the following specification: (4)

Private members:

adno integer

name 20 characters

marks an array of 5 floating point values

average float

getavg() to compute the average obtained in five subjects

public members:

readinfo() to accept values for adno, name, marks and invoke the function

getavg()

displayinfo() function to display all data members of report on the screen

c) What do you understand about a member function? How does a member function differ from an ordinary function? (2)

3.a) Distinguish between the following two statements: (2)

time T1(13, 10, 25);

time T1=time(13, 10, 25)

b) Differentiate between a constructor and destructor function. (2)

c) What do you understand by constructor overloading (2)

d) Define a class Serial in C++ with the following specifications: (4)

Private members of class Serial

Serialcode integer

Title 20 characters

Duration float

Noofepisodes integer

Public member of class Serial

A constructor function to initialize Duration as 30 and Noofepisodes as 10;

Newserial() function to accept values for Serialcode and Title

Otherentries() function to assign the values of Duration and Noofepisodes with the help of corresponding values passed as parameters to this function.

Dispdata() function to display all the data members on the screen.

4.a) Consider the following declarations and answer the questions given below: (4)

class PPP

{ int H;

protected:

int S;

public:

void INPUT();

void OUT();

};

class QQQ : private PPP

{ int T;

protected:

int U;

public:

void INDATA();

void OUTDATA();

};

class RRR : public QQQ

{ int M;

public:

void DISP();

};

i) Name the base class and derived class of the class QQQ.

ii) Name the data member(s) that can be accessed from function DISP().

iii) Name the member function(s) which can be accessed from the objects of class RRR.

iv) Is the member function OUT() accessible by the objects of the class QQQ?

b) Differentiate between functions read() and write(). (2)

c) Assuming the class FLOPPYBOX, write functions in C++ to perform the following:

i) Write the objects of FLOPPYBOX to a binary file.

ii) Read the objects of FLOPPYBOX from binary file and display them on screen.

Class FLOPPYBOX (4)

{ int size;

char name[20];

public:

void getdata(void) { cin>>size>>name; }

void showdata(void) { cout<<

5.a) Change the following infix expression into postfix expression. (4)

(A+B) * C + D / E – F ;

b) An array T[15][10] is stored in the memory with each element requiring 2 bytes of storage. If the base address of T is 2000, determine the location of T[7][8] when the array is T stored by: (4)

i) Row major ii) Column major

c) Write a user – defined function in C++ to display the sum of two matrices. (2)

6.a) Evaluate the following post fix expression using a stack and show the contents of stack after execution of each operation: (4)

50, 40, +, 18, 14, -, 4, *, +

b) Sort the following numbers manually using the bubble sort method: (2)

80 , 17, 27, 58, 20, 66, 55

c) Differentiate between a LIFO list and a FIFO list. (2)

d) A circular queue is maintained in an array called Q[20]. Find the number of elements currently present in the queue if FRONT = 7 and REAR = 3. (2)

7. a) Write SQL commands for (i) to (vi) and write the outputs for (vii) on the basis of table Hospital. (10)

Table: Hospital

No. Name Age Department Dateofadm Charges Sex
1 Sandeep 65 Surgery 23/02/98 300 M
2 Ravina 24 Orthopedic 20/01/98 200 F
3 Karan 45 Orthopedic 19/02/98 200 M
4 Tarun 12 Surgery 01/01/98 300 M
5 Zubin 36 ENT 12/01/98 250 M
6 Ketaki 16 ENT 24/02/98 300 F
7 Leena 29 Cardiology 20/02/98 800 F
8 Zareen 45 Gynecology 22/02/98 300 F
9 Kush 19 Cardiology 13/01/98 800 M
10 Shailya 31 Nuclear Medicine 19/02/98 400 F
i)To show all information about the patients of cardiology department.

ii)To list the names of female patients who are in orthopedic department.

iii)To list names of all patients with their date of admission in ascending order.

iv)To display patient’s Name, Charges, AGE for only male patients only.

v)To count the number of patients with Age greater than 30.

vi)To insert a new row in the Hospital table with the following data:

11, “ Nipan “, 26 , “ENT”, {25/02/98}, 50, “ M “

vii)Give the output of following SQL statements:

a)Select COUNT(distinct Department) from Hospital;

b)Select MAX(Age) from Hospital where Sex = “M”;

c)Select AVG(Charges) from Hospital where Sex = “ F “;

d)Select SUM(Charges) from Hospital where Dateofadm < {12/08/98}

  « Sample Paper MS 01 Management Functions and Behaviour – 1 Guess Paper Computer Science (Set-5) »  

  Posted on Friday, December 26th, 2008 at 11:32 AM under   CBSE | RSS 2.0 Feed