Anda di halaman 1dari 3

9036

0708-II
3 Hours / 80 Marks Seat No.

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

Instructions - (1) All Questions are compulsory.


(2) Figures to the right indicate full marks.
(3) Assume suitable data, if necessary.
(4) Use of Non-programmable Electronic Pocket
Calculator is permissible.

1. Attempt any EIGHT of the following : 16

(a) Give 4 characteristics of object oriented programming.


(b) Which are input and output operator in C++? Give its examples.
(c) Define class with syntax.
(d) How many ways we can define member function in class? Give its
syntax.
(e) Give any 4 characteristics of constructor.
(f) Define parameterized constructor with its syntax?
(g) What are the ways of constructor calling in main program? Give its
syntax?
(h) Write the advantages of pointer.
(i) Define virtual function with its syntax.
(j) What do you mean by polymorphism? State two types of
polymorphism.

2. Attempt any THREE of the following : 12

(a) What do you mean by inheritance? Give different types of


inheritance.
(b) What is the scope of base class members inherited in derived class
in the following code :
class bases
{
int i, j :
public :
void set (int a, int b) :
void show ( ) :
}
class derived : public base
{ int Ki
public :
derived ( int x )

Object Oriented Programming: MSBTE Question Paper, Summer – 2008


------------
------------
-------------
}
& state in how many types we can inherits properties of base class in
Derived class ?
c) Write any program which shows compile time polymorphism using
function overloading.
d) Write a program for following hierarchy inheritance in the given Figure.
No.1 Assume suitable member function.

Staff
Code

Teacher Officer
Subject Grade

Fig. No. 1

3. Attempt any THREE of the following: 12


a) In how many ways we can use pointer in functions definitions
explain it?
b) What do you mean by pointer? Which are the pointer operators
present? Give its example?
c) What is runtime polymorphism? Explain with suitable example?
d) Declare a class simple interest having data members as principle
amount, rate of interest, no. of years. The constructor will have
default value of rate of interest as 11.5%. Accept this data for two
objects. Calculate and display simple interest for each object?

4 Attempt any TWO of the following: 16


a) Write a program to declare a class rectangle haying data members
length and breadth. Accept this data for one object and display area
and perimeter of rectangle.
b) Write a program to declare class time having data member as hrs,
min, sec. Write a constructor to accept data and use display
function for two objects.
c) Write a program to implement inheritance as shown in Figure No. 2.
Assume suitable data member function to accept and display
function.

Object Oriented Programming: MSBTE Question Paper, Summer – 2008


depositor
Acc-no
balance

borrower
Loan-no
Loan-amount

Fig. No. 2

5. a) Attempt the following: 12


Compare Structure and Class.
b) Attempt any ONE of the following:
(i) Write a program to find sum of three numbers using pointer to
function method?
(ii) What will be the o/p of following program?
int main ( )
{
cout. fill (‘<’) ;
cout. precision ( 3) ;
for ( int n = 1 ; n < = 6 ; n+ + )
{
cout. width (5) ;
cout. << n ;
cout. width ( 10) ;
cout << 1.01 float (n) << “\n”;
if (n = = 3 ) ;
cout. fill( ‘#’) ;
}
cout. width(15) ;
cout << 12.345678 ;
return 0 ;
}

6. Attempt any THREE of the following: 12


a) Describe memory allocation for objects.
b) Give syntax and use of following with respect to file
(i) get ( )
(ii) put ( )
c) How we open file using constructor? Write any program for creating
files with constructor function.
d) Explain different file opening modes in details.

______________

Object Oriented Programming: MSBTE Question Paper, Summer – 2008

Anda mungkin juga menyukai