Pokhara University
Level: Bachelor
|
Semester – Spring
|
Year : 2005
|
Programme: BE
|
Full Marks : 100
|
|
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)
Describe object oriented programming as a new
paradigm. What are the unique advantages of it?
b)
Explain state, behaviour and identity in light of
object-oriented paradigm.
|
7
8
|
2.
|
a)
Define classes and objects? How does a class
accomplish data encapsulation?
b)
What do you mean by memory recovery? Explain the
term stack versus heap storage allocation.
|
8
7
|
3.
|
a)
Explain the purpose of constructor and destructor.
Describe their significances. Can we have more than one destructor in a
class? Explain it.
b)
Create a class called Student with six data members
(rollno, name, marks in english, maths, and science, total), a constructor
that initialises the data members to the values passed to it as parameters, a
function called calctotal() that calculates the total of the marks obtained
in the three subjects, and a function called display() that displays the
details of the student.
In main, create two objects of the class Student and for each object
call the calctotal() and the display() functions.
|
7
8
|
4.
|
a)
What does inheritance mean in C++? Describe the
syntax of the single and multiple inheritances. When do we use the protected
visibility specifier to a class member?
b) An Education institute
wishes to maintain a database of its employees. The database is divided into
a number of classes whose hierarchical relationships are shown in figure. The
figure also shows the minimum information required for each class. Specify
all the classes and define functions to create the database and retrieve
individual information as an when required.
|
6
9
|
5.
|
a)
What is a pure virtual function? What implications
it applies when a function is declared as pure virtual function? Give an
example.
b)
What is operator overloading? Why is it necessary
to overload an operator? Explain with suitable example.
|
2+2+4
7
|
6.
|
a)
What is containership? How does it differ from
inheritance?
b)
Why type casting is important in OOP? Define two
classes Time12 and Time24 that represents time in 12 hour and 24 hour format
respectively. Write a conversion routine to convert time from one format to
another.
|
5
2+8
|
7.
|
Write short notes on (Any Two):
a) new and delete
operator
b) Templates
c) Static Data
members
d) this printer
|
2x5
|
KAdamba | Online Casino, Situs Judi Slot Online Terbaik
ReplyDeleteKadamba situs judi slot online terbaik yang memiliki game febcasino slot online gacor terpercaya 메리트 카지노 2021 dan provider 온카지노 slot gacor terbaik di indonesia.
Harrah's Resort Southern California in Valley Center opens on Friday
ReplyDeleteHarrah's Resort Southern California 안성 출장샵 in Valley Center 상주 출장안마 announced the opening 춘천 출장안마 of 원주 출장샵 its $140 Million Spa & Gourmet 부산광역 출장샵 Food and Lounge,