Pokhara University
Level:
Bachelor
|
Semester: Fall
|
Year : 2010
|
Programme: BE
|
Full Marks: 100
|
|
Course: Object Oriented Programming in
C++
|
Pass Marks: 45
|
|
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 makes OOP a new paradigm? Explain your with
suitable points.
b)
Differentiate between:
i.
Programming in small and programming in large
ii.
Interface and implementation
|
7
8
|
2.
|
a)
Explain various access speicifiers Used in C++
with an example.
b)
Differentiate between constructor and destructor.
Can there be more than one destructor in a program for destroying the same
object. Illustrate your answer.
|
7
8
|
3.
|
a)
Explain the principal of substitutability. How
does inheritance provide the concept of reusability? How do you define
reusability of components?
b)
Differentiate between static and dynamic memory
allocation. Write a simple program explaining the use of dynamic memory
allocation which should include calculation of marks of 5 subjects of
students and displaying the result as pass or fail. Pass mark is 45 out of
100 in each subject.
|
7
8
|
4.
|
a)
Differentiate between Class and Structure. Explain
them with example.
b)
Create a class called Student with three data
members (stdnt_name [20], faculty [20], roll_no), a function called readdata
() to take the details of the students from the user, and a function called
displaydata () to display the details of the students. In main, create two objects
of the class Student and for each object call both of the functions.
|
7
8
|
5.
|
a)
What is a hybrid inheritance? Explain any three pros
and three cons of inheritance?
b)
Develop a complete program for an institution
which wishes to maintain a database of its staff. Declare a base class STAFF
which include staff_id and name. Now develop records for the following staffs
with the given information below:
i.
Lecturer (subject, department)
ii.
Administrative staff (post, department)
Each staff members should inherit staff_id
and name from base class.
|
8
7
|
6.
|
a)
What is polymorphism? Explain run-time
polymorphism and compile time polymorphism with example each.
b)
Explain about deferred methods.
|
10
5
|
7.
|
Write short notes on (Any Two)
a)
CRC cards
b)
Containership
c)
Templates
|
2×5
|
No comments:
Post a Comment