Bsc Csit Nepal

Model

Object Oriented Programming

Full Marks: 60
Pass Marks: 24
Time: 3 hours

Long Questions:

Attempt any two questions: (2 × 10=20)

  1. What is object oriented programming? Explain objects, class, encapsulation, data hiding, inheritance, and polymorphism.
  2. Explain operator overloading. Write a program that overloads insertion and extraction operators.
  3. What is inheritance? Explain the ambiguities associated with multiple inheritance with suitable example programs.

Short Questions

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

  1. Explain the purpose of a namespace with suitable example.
  2. What is the principle reason for passing arguments by reference? Explain with suitable code.
  3. Why constructor is needed? Explain different types of constructors with example.
  4. Write a program that illustrates the conversions between objects of different classes having conversion function in source object.
  5. Explain the difference between private and public inheritance with suitable diagram.
  6. Why friend function is required? Discuss with example.
  7. How late binding is different from early binding. Write a program that explains late binding using virtual function.
  8. Why do we need exceptions? Explain “exceptions with arguments” with suitable program.
  9. What are the advantages of using the stream classes for I/O? Write a program that writes object to a file.