Pokhara University
Level: Bachelor
|
Semester – Fall
|
Year : 2005
|
Programme: BE
|
Full Marks: 100
|
|
Course: Object Oriented Programming
|
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)
Why OOP is known as a new paradigm? Illustrate
with certain examples.
b)
What is memory recovery? How does stack differ
from heap memory allocation.
|
8
7
|
2.
|
a) What is a
class? Explain the different types of classes.
b) Create a class
called Employee with three data members (empno, name, address), a function
called readdata() to take in the details of the employee from the user, and a
function called displaydata() to display the details of the employee. In
main, create two objects of the class Employee and for each object call the
readdata() and the displaydata() functions.
|
2+6
7
|
3.
|
a) What does
contructor mean? Explain the different types of constructors with a suitable
example.
b) Write a program
using only constructor to find the area of a square and rectangle. Also
initialize the object dynamically.
|
7
8
|
4.
|
a) What is
polymorphism? Differentiate between compile time and run time polymorphism
with program in each.
b) What is hybrid
inheritance? Does ambiguity occurs in this type of in this type of
inheritance? If yes explain it.
|
9
6
|
5.
|
a) What is
operator overloading? Write a program to overload the arithmetic operators
(+, -, *, /).
b) Define two
classes named ‘Polar’ and ‘Rectangle’ to represent points in polar and
rectangle systems. Use conversion routines to convert from one system to
another system.
|
8
7
|
6.
|
a) Write a program
using template to add two integers; two floats and one integer and one float
numbers respectively. Display the final result in float.
b) What is
exception handling? Discuss briefly.
|
10
5
|
7.
|
Write short notes on (Any
Two)
a) CRC Cards
b) Container
Classes
c) Friend Function
d) Software
Reusability
|
|
No comments:
Post a Comment