Tribhuwan University

Institute of Science and Technology

Model

Bachelor Level / First Year / Second Semester / Science

Bachelors in Information Technology (BIT153)

(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 Answers Questions

Attempt any TWO questions.
[2*10=20]
1.
Write a program to create a class Customer with data members customer Id, Name, and age. Put member functions to read and display values of data members. Also define constructors to initialize data members with default value. Finally create object to read and display data of 10 customers.[10]
2.
Create a class Employee with private data members Eid, Ename, and Salary. Include public member functions to read and display value of data members. Derive a class names Typist from above class. The class should contain a private data member typing_speed and public member functions to read and display values of data members. Finally create two objects of typist class and read and display their values.[10]
3.
What are the different ways of achieving static polymorphism? Discuss overloading of pre-increment and post-increment operators with suitable examples. [5+5]
Section B

Short Answers Questions

Attempt any Eight questions.
[8*5=40]
4.
What is meant by default argument? Explain with suitable example. [5]
5.
What are the uses of this pointer? Discuss its concept with suitable example. [5]
6.
What is destructor? Discuss its characteristics with suitable example. [5]
7.
Write a program to convert floating point value to object of distance class with data members feet and inch. [5]
8.
How late binding differs from early binding? How can you achieve dynamic polymorphism? Explain with example. [5]
9.
What is meant by ambiguity? Explain ambiguity in multiple inheritance and its solution with example. [5]
10.
Write a program to handle "array index out of range" exception. [5]
11.
Why concept of templates is important? Explain function templates with example. [5]
12.
Write a program to read text from keyboard and write it to a file named "test.txt". Again read the content of file and display it in the monitor. [5]