BIT 2nd Semester
Object Oriented Programming Board Question Paper 2080

Views: ...

BIT 153-2080 ✡
Tribhuvan University
Institute of Science and Technology
2080
Bachelor Level/First Year/Second Semester/Science
Bachelors in Information Technology (BIT 153)
(Object Oriented Programming)
Full Marks:60 Pass Marks:24 Time:3 hours

Candidates are required to give their answers in their own words as for as practicable.
The figures in the margin indicate full marks

Section A
Long Answer Questions
Attempt any Two question.
[2x10=20]
1.

What is constructor? Explain its types with suitable example. How is the constructor called in a derived class in C++?

2.

What is Polymorphism in Object Oriented Programming? Implement a class Employee with a virtual function CalculateSalary() that returns the salary of the employee. Create two derived classes HourlyEmployee and SalariedEmployee. Override the CalculateSalary() function in both derived classes to calculate the salary of an hourly employee and a salaried employee respectively. Write a program that creates objects of both derived classes and calls the CalculateSalary() function for each.

3.

What is operator overloading? Write a complete C++ program to overload + operator to add two objects of class 'Time'.

Section B

Attempt any Eight questions

[8x5=40]
4.

What is the difference between public, private and protected inheritance in C++?

5.

What is exception handling? Explain types of exception handling and explain with suitable example.

6.

What is friend function? Write a program to add private member of two different classes using friend function.

7.

Write a program to demonstrate returning object from functions in C++.

8.

How 'this' pointer is used to resolve name conflict between local variable and member variable in C++? Explain with example.

9.

Write a Program to read and write values through object using File Handling.

10.

What do you mean by class template in C++? Write a program in C++ containing function template which determines the greater number between two integer inputs and two floating point inputs.

11.

Differentiate between function overloading and function overriding in C++.

12.

Illustrate the use of static variable with a simple program.