Bsc Csit Nepal

2075-old

Object Oriented Programming

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

Long Questions:

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

  1. Discuss the feature of Object-Oriented Programming. Differentiate between Object Oriented  Programming and any other programming language that you know.
  2. How can you convert the user defined data type into primitive data type and vice versa? Explain both conversion routine with suitable example.
  3. Create a class Stack with suitable data members and member functions to push and pop the elements of the stack. Add the exception when user tries to add item while the stack is full and when user tries to delete item while the stack is empty. Throw exception in both of the cases and handle these exception.

Short Questions

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

  1. “Concept of friend in against the philosophy of Object Oriented Programming”. Explain.
  2. Explain about the importance of constructors and destructors with their execution sequence.
  3. What is template? How can you differentiate a function template from a class template? Explain.
  4. Explain about this pointer with suitable example.
  5. Write a C++ program containing a possible exception. Use a try block to throw it and a catch block to handle it.
  6. Differentiate between compile time polymorphism and run time polymorphism.
  7. What is container class? Differentiate container class from inheritance.
  8. Write a program to demonstrate the use of default argument  in functions.
  9. How can you differentiate a macro with an inline function? Are they same or different? Justify.
  10. Define the various ambiguity situations that may occur during the process of inheritance. How can you resolve that ambiguity situation?