Sunteți pe pagina 1din 2

POKHARA UNIVERSITY

Level: Bachelor Semester – Spring Year : 2009


Programme: BE Full Marks: 100
Pass Marks: 45
Course: Object Oriented Programming in C ++ Time : 3hrs.
Candidates are required to give their answers in their own words as far
as practicable.
The figures in the margin indicate full marks.
Attempt all the questions.

1. a) What are the critical issues that are to be considered while 8


designing the large programming? Why.
b) What are the advantages of adopting RDD? Explain with a help of
7
a suitable example.
2. a) What are constructors and destructors? Explain their types and 8
uses, with good illustrative example? What difference would be
experienced if the features of constructors and destructors were
not available in C++.
b) Create a class called Volume that uses three Variables(length,
7
width, height) of type distance(feet and inches) to model the
volume of a room. Read the three dimensions of the room and
calculate the volume it represent, and print out the result. The
volume should be in (feet3) form i.e. you will have to convert each
dimension in to feet and fraction of foot. For instance, the length
12 feet 6 inches will be 12.5 ft.
3. a) What is a function? Discuss the use of friend function taking in to 7
consideration the concept of data hiding in object oriented
programming.
b) Write a program overloading the unary '++' operator to increment
8
the object of a class calendar. The overloaded increment operator
should increment days, weeks, months, and years with a step size
of a single day. Define the suitable class as per the necessity of the
program. Make size of month equal to 30 days.
4. a) What does Inheritance mean in C++? Explain the disadvantages 5
of inheritance.
b) How does inheritance in programming aid reusability? What are
5
the cost/demerits of inheritance.
c) Explain hybrid inheritance and virtual classes/members with
5
example program.

1
5. a) What do you mean by Stack Versus heap? Explain about memory 8
recovery. Explain the use of new and delete operator.
b) What will be the order of constructor invocation for the following 7
code snippet:
Class Date {
.
….
};
Class Time {
………
……….
};
Class Bus }
int bus () ;
Date dep- date ;
Time dep-time;
…..
……
};
int main ( )
{
Date D1 ;
Time T1 ;
Bus bs 1
….
….
}
6. a) Write a program to convert polar coordinate system to rectangular 7
coordinate system. Write the conversion function in source class.
b) Create an abstract base class shape with two members base and 8
height, a member function for initialization and a pure virtual
function to compute area ( ). Derive two specific classes Triangle
and Rectangle which override the function area ( ). Use these
classes in a main function and display the area of a triangle and a
rectangle.
7. Write short notes on (Any Two): 2x5
a) Non linear Behaviour of Complexity
b) Exeption Handling
c) Cohesion and coupling

S-ar putea să vă placă și