Tribhuvan University
Institute of Science and Technology
2080-new
Bachelor Level / second-semester / Science
Computer Science and Information Technology( CSC166 )
Object-Oriented Programming
Full Marks: 60 + 20 + 20
Pass Marks: 24 + 8 + 8
Time: 3 Hours
Candidates are required to give their answers in their own words as far as practicable.
The figures in the margin indicate full marks.
SECTION A
Attempt any TWO question.
What is destructor? List its characteristics. Explain the use of default copy constructor with an appropriate example.
Write a program to create a class named height with data members meter(int) and centimeter(int). Overload the binary + operator using friend function to add two heights.

Write a program to realize the above hierarchy. Create necessary member functions (constructor) to initialize and diaplay necessary information.
SECTION B
Attempt any EIGHT question.
Define object. What are the benefits of Object Oriented Programming Language?
Explain the significance of type conversion. How do we achieve dynamic memory allocation in C++? Explain with an example.
What is the benefit of passing object as arguments? Write a program to create a class named actor with data members name and rating. Initialize the data members and display those names whose rating is greater than 5 using the concept of constant object.
Create two classesRupee and Dollar respectively. Write conversion operator to convert between Rupee and Dollar assuming that 1 dollar equals 133 rupees. Write a main program that allows the user to enter an amount in either currncy and then converts it to other currency and displays the result.
Explain the practical implication of protected specifier in inheritance. list advantages and disadvantages of inheritance.
Difference between compile time and run time polymorphism.
Explain function template overloading with suitable example.
Write a program that stores information of employees in a file and displays the file’s content in ascending order of their salary.
Write short notes on :