BE Computer Engineering (IOE, TU) Object Oriented Programming (IOE, CT 501) Question Paper 2079
This is the official BE Computer Engineering (IOE, TU) Object Oriented Programming (IOE, CT 501) question paper for 2079, as set in the regular annual examination. It carries 80 full marks and a time allowance of 180 minutes, across 12 questions. On Kekkei you can attempt this Object Oriented Programming (IOE, CT 501) past paper online with a timer, get instant AI feedback and step-by-step solutions, and track the topics where you lose marks — completely free. Whether you are revising for your BE Computer Engineering (IOE, TU) Object Oriented Programming (IOE, CT 501) exam or solving previous years' question papers, this 2079 paper is a great way to practise under real exam conditions.
Section A: Long Answer Questions
Attempt all / any as specified.
Differentiate between procedural programming and object-oriented programming. Define a class and an object with suitable examples. Write a C++ program to create a class Distance having data members feet and inches. Use a parameterized constructor to initialize the data members and a member function display() to show the distance. Also create an array of three Distance objects and display them.
(a) Explain the different types of inheritance supported in C++ with suitable diagrams. What is the ambiguity problem in multiple inheritance and how is it resolved using virtual base classes? (b) Define a base class Shape with a virtual function area(). Derive classes Circle and Rectangle from it and override area() in each. Write a program that uses base-class pointers to compute and display the area of different shapes, demonstrating run-time polymorphism.
What is operator overloading? Explain the rules and restrictions for overloading operators in C++. Write a C++ program to define a class Complex to represent complex numbers, and overload the + and * operators to add and multiply two complex numbers respectively. Also overload the insertion operator (<<) using a friend function to display a complex number.
(a) What are templates? Differentiate between function templates and class templates with examples. Write a function template to find the maximum of two values of any data type. (b) Explain exception handling in C++ using try, catch and throw keywords. Write a program that throws and handles an exception when an attempt is made to divide a number by zero.
Section B: Short Answer Questions
Attempt all / any as specified.
What is a copy constructor? Explain when it is invoked. Write a C++ program to demonstrate the use of a copy constructor and explain the difference between a shallow copy and a deep copy.
What are static data members and static member functions? Explain their characteristics. Write a program using a static data member to count the number of objects created from a class.
What is a pure virtual function? Explain the concept of an abstract class with a suitable example. Why can an object of an abstract class not be created?
Explain the classes used for file handling in C++. Write a C++ program to write a list of student records (roll number and name) to a file and then read and display the records from the file.
Explain the order in which constructors and destructors are called in a derived class under single inheritance. Illustrate your answer with a suitable C++ program that includes constructors and destructors in both base and derived classes.
Write short notes on any TWO of the following:
(a) this pointer
(b) Function overloading vs operator overloading
(c) Rethrowing an exception
(d) Inline functions
What is a friend function? Explain its merits and demerits. Write a C++ program to find the sum of private data members of two different classes using a single friend function.
Differentiate between compile-time polymorphism and run-time polymorphism with examples. Explain how function overloading and virtual functions support these two forms of polymorphism in C++.