Tribhuvan University
Bachelor of Information Technology
Semester 2 · TU Board 2078
Course Title: Object Oriented Programming (BIT153)
Full Marks: 60Pass Marks: 24Time: 3 hours
Candidates are required to give their answers in their own words as far as practicable.
Group A
Attempt any Two questions.(2 × 10 = 20)
- 1.10
Create a class Employee with private data members Eid, Ename, and Salary. Include public member functions read and display value of data members. Derive a class names typist from above class. The class should contain a private data members. Finally create two objects of typist class and read and display their values.
- 2.10
What is object-oriented programming? How does it differ from procedure-oriented programming? Explain features of object oriented programming.
- 3.10
Create a class called time that has separate int member data for hours, minutes, and seconds. One constructor should initialize this data to 0, and another should initialize it to fixed values. Another member function should display it, in 11:59:59 format. The final member function should add two objects of type time passed as arguments. A main() program should create two initialized time objects (should they be const?) and one that isn't initialized. Then it should add the two initialized values together, leaving the result in the third time variable. Finally, it should display the value of this third variable Make appropriate member functions const.
Group B
Attempt any Eight questions(8 × 5 = 40)
- 4.5
Explain Memory Management Operators of C++ with example.
- 5.5
Explain Call by Value and Call by Reference with appropriate example.
- 6.5
Describe types of constructors with an example.
- 7.5
Explain use of objects as function arguments with example.
- 8.5
List out various type conversion techniques? Explain basic to user-defined type conversion with example.
- 9.5
How-late binding differs from early binding? How can you achieve dynamic polymorphism? Explain with example.
- 10.5
Explain pure virtual functions with example.
Answer comingAlso asked in 2079
- 11.5
What is exception handling? Explain how to handle an exception with appropriate example.
Answer comingAlso asked in 2080
- 12.5
Write a program that writes the contents of file 1 into file 2.
— The End —