Object Oriented Programming 2068

Tribhuwan University
Institute of Science and Technology
2068
Bachelor Level / Third Semester / Science
Computer Science and Information Technology ( CSC-202 )
( 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

Attempt any two questions: (2x10=20)

1. What are the main features of the Object-Oriented Programming? Explain with suitable practical examples.

10 marks view

2. Explain the role of constructor and destructor in Object-Oriented Programming. Discuss user defined parameterized constructor with suitable example.

10 marks view

3. Define a Shape class (with necessary constructors and member functions) in Object-Oriented Programming (abstract necessary attributes and their types). (Write a complete code in C++ programming language) 

• Derive Triangle and Rectangle classes from Shape class adding necessary attributes. 

• Use these classes in a main function and display the area of triangle and rectangle.

10 marks view

Section B

Attempt any eight questions: (8x5 = 40)

4. Why dynamic object is needed? Explain with suitable example.

5 marks view

5. What is function overloading? Explain with suitable example.

5 marks view

6. Write a C++ program containing a possible exception. Use a try block to throw it and a catch block to handle it properly.

5 marks view

7. Differentiate between base class and derived class with suitable examples.

5 marks view

8. Differntiate between private, public and protected variable with suitable example.

5 marks view

9. Differentiate container class from inheritance. Explain with suitable example.

5 marks view

10. Explain the role of polymorphism in Object Oriented Programming.

5 marks view

11. Explain about “this” pointer with suitable example.

5 marks view