Object Oriented Programming Model Question

Tribhuwan University
Institute of Science and Technology
Model Question
Bachelor Level / Second Semester / Science
Computer Science and Information Technology ( CSC161 )
( Object Oriented Programming )
Full Marks: 60
Pass Marks: 24
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

Long Answer Questions

Attempt any two questions.         [2*10=20]

1. What is object oriented programming? Explain objects, class, encapsulation, data hiding, inheritance, and polymorphism.

10 marks view

2. Explain operator overloading. Write a program that overloads insertion and extraction operators.

10 marks view

3. What is inheritance? Explain the ambiguities associated with multiple inheritance with suitable example programs.

10 marks view

Section B

Short Answer Questions

Attempt any eight questions.         [8*5=40]

4. Explain the purpose of a namespace with suitable example.

5 marks view

5. What is the principle reason for passing arguments by reference? Explain with suitable code.

5 marks view

6. Why constructor is needed? Explain different types of constructors with example.

5 marks view

7. Write a program that illustrates the conversions between objects of different classes having conversion function in source object.

5 marks view

8. Explain the difference between private and public inheritance with suitable diagram.

5 marks view

9. Why friend function is required? Discuss with example.

5 marks view

10. How late binding is different from early binding. Write a program that explains late binding using virtual function.

5 marks view

11. Why do we need exceptions? Explain “exceptions with arguments” with suitable program.

5 marks view

12. What are the advantages of using the stream classes for I/O? Write a program that writes object to a file.

5 marks view