CSC166 · TU past paper
Object Oriented Programming 2076 question paper
The complete TU 2076 exam paper for Object Oriented Programming (CSC166), all 12 questions with solved model answers written to the mark scheme.
Tap a question to open its answer.
- Q1.10 marksTypes of inheritanceHideAnswer
Write a program according to the specification given below:- Create a class Teacher with data members id & subject and member functions for reading and displaying data members.- Create another class Staff with data members id & position, and member functions for reading and displaying data members.- Derive a class Coordinator from Teacher and Staff and the class must have its own data member department and member functions for reading and displaying data members.- Create two object of Coordinator class and read and display their details.[10]
- Q2.10 marksFundamental of operator overloadingHideAnswer
Explain the concept of operator overloading? List the operators that cannot be overloaded. Write programs to add two object of distance class with data members feet and inch by using member function and friend function.[10]
- Q3.10 marksPolymorphism and its rolesHideAnswer
Explain types of polymorphism briefly. Write down roles of polymorphism. How can we achieve dynamic polymorphism briefly? Write down roles of polymorphism. How can we achieve dynamic polymorphism? Explain with example.[10]
- Q4.5 marksFunctionsHideAnswer
What is meant by return by reference? How can we return values by reference by using reference variable? Illustrate with example. [5]
- Q5.5 marksInitialization of class objectsHideAnswer
What is destructor? Write a program to show the destructor call such that it prints the message 'memory is released'. [5]
- Q6.5 marksThis pointerHideAnswer
What is this pointer? How can we use it for name conflict resolution? Illustrate the use of multiple catch statement with example. [5]
- Q7.5 marksCharacteristics of object oriented languagHideAnswer
How object oriented programming differs from object based programming language? Discuss benefits of OOP. [5]
- Q8.5 marksDynamic Memory Allocation with new and delHideAnswer
What is use of new and delete operators? Illustrate with example. What are advantages of new over malloc. [5]
- Q9.5 marksExceptional HandlingHideAnswer
How can define catch statement that can catch any type of exception? Illustrate the use of multiple catch statement with example. [5]
- Q10.5 marksFunction templatesHideAnswer
What is meant by template? How can you define function template to return maximum of two integers, floats, or characters? Explain with example. [5]
- Q11.5 marksRead/Write from FileHideAnswer
Which function can be used for reading and writing object? Define briefly. Write a program that reads values of two objects of students class (assume data members are id, name, and level) and display the data in monitor. [5]
- Q12.5 marksInput/Output Streams and ManipulatorsHideAnswer
Write short notes on:- Cascading of IO operation - Pure Virtual Function [5]