Object Oriented Programming 2078

Question Paper Details
Tribhuwan University
Institute of Science and Technology
2078
Bachelor Level / Second Semester / Science
Information Technology ( Na )
( Object Oriented Programming )
Full Marks: 60
Pass Marks: 24
Time: 3 hours

Section A

Long Answer Questions

Attempt any two questions.     (2 x 10 = 20)

Official Answer
AI Generated Answer

AI is thinking...

1. 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 member typing speed and public member functions to read and display values of data members. Finally create two objects of typist class and read and display their values.

10 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

2. What is object-oriented programming? How does it differ from procedure-oriented programming? Explain features of object oriented programming.

10 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

3. 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.

10 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

Section B

Short Answer Questions

Attempt any eight questions.     (8×5=40)

Official Answer
AI Generated Answer

AI is thinking...

4. Explain Memory Management Operators of C++ with example.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

5. Explain Call by Value and Call by Reference with appropriate example.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

6. Describe types of constructors with an example.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

7. Explain use of objects as function arguments with example.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

8. List out various type conversion techniques? Explain basic to user-defined type conversion with example.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

9. How late binding differs from early binding? How can you achieve dynamic polymorphism? Explain with example.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

10. Explain pure virtual functions with example.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

11. What is exception handling? Explain how to handle an exception with appropriate example.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

12. Write a program that writes the contents of file 1 into file 2.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...