Tribhuvan University
Bachelor of Information Technology
Semester 2 · TU Board 2079
Course Title: Object Oriented Programming (BIT153)
Full Marks: 60Pass Marks: 24Time: 3 hours
Candidates are required to give their answers in their own words as far as practicable.
Group A
Attempt any Two questions.(2 × 10 = 20)
- 1.10
What do we need template? Why the program terminate after the occurrence of exception? Describe the types of constructor.
- 2.10
Differentiate between abstract class and concrete class. Write a program to create a class named "Quadratic" that represents a function of the form f(x) = ax + bx + c, where x is a real variable and a, b, c are real constants. The class must satisfy the following requirements. a. A constructor should be provided that takes the values of a, b and c as arguments. All three of these arguments should default to zero. b. A function that takes a single argument x return the value of f(x). c. All data members should be private.
- 3.10
Explain the chain of constructor and destructor between sub classes and super classes during inheritance with example. Create a class named "Point" with data members x and y. Overload the + operator to add the value of two objects of this class.
Group B
Attempt any Eight questions(8 × 5 = 40)
- 4.5
Can we use object oriented concept using structure instead of classes? Justify your opinion.
- 5.5
In which case default argument is used? Describe with an example.
- 6.5
What is the task of static data members and function? Illustrate with an example.
- 7.5
Differentiate between aggregation and inheritance. Why do we need virtual base class?
- 8.5
Define stream. How do you read the text from file? Describe.
- 9.5
Explain the features of OOP.
- 10.5
Define namespace. List any two manipulators with their uses.
- 11.5
Why do we need friend class? How can we define member function outside the class?
- 12.5
Explain the use of pure virtual function with example.
Answer comingAlso asked in 2078
— The End —