Tribhuvan University
Bachelor of Science in Computer Science and Information Technology
Semester 2 · TU Board 2080 (new course)
Course Title: Object Oriented Programming (CSC166)
Full Marks: 60Pass Marks: 24Time: 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.
Group A
Attempt any TWO question.(2 × 10 = 20)
- 1.10
What is destructor? List its characteristics. Explain the use of default copy constructor with an appropriate example.
Answer comingAlso asked in 2079
- 2.10
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.
Answer comingAlso asked in 2080
- 3.10
[figure in the original paper]
Write a program to realize the above hierarchy. Create necessary member functions (constructor) to initialize and diaplay necessary information.
Group B
Attempt any EIGHT question.(8 × 5 = 40)
- 4.5
Define object. What are the benefits of Object Oriented Programming Language?
Answer comingAlso asked in 2082, 2081, 2079, 2076, 2075
- 5.5
Explain the significance of type conversion. How do we achieve dynamic memory allocation in C++? Explain with an example.
- 6.5
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.
- 7.5
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.
- 8.5
Explain the practical implication of protected specifier in inheritance. list advantages and disadvantages of inheritance.
- 9.5
Difference between compile time and run time polymorphism.
- 10.5
Explain function template overloading with suitable example.
- 11.5
Write a program that stores information of employees in a file and displays the file's content in ascending order of their salary.
- 12.5
Write short notes on :
- This pointer
- ios member function
— The End —