Object Oriented Programming Model Question

Question Paper Details
Tribhuwan University
Institute of Science and Technology
Model Question
Bachelor Level / Second Semester / Science
Information Technology ( Na )
( Object Oriented Programming )
Full Marks: 60
Pass Marks: 24
Time: 3 hours

Section A

Attempt ANY TWO         [10 ×2=20]

Official Answer
AI Generated Answer

AI is thinking...

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 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

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 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

3. What are the different ways of achieving static polymorphism? Discuss overloading of pre-increment and post-increment operators with suitable examples. 

10 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

Section B

Attempt ANY EIGHT         [5 ×8=40]

Official Answer
AI Generated Answer

AI is thinking...

4. What is meant by default argument? Explain with suitable example.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

5. What are the uses of this pointer? Discuss its concept with suitable example.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

6. What is destructor? Discuss its characteristics with suitable example.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

7. Write a program to convert floating point value to object of distance class with data members feet and inch. 

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

8. How late binding differs from early binding? How can you achieve dynamic polymorphism? Explain with example.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

9. What is meant by ambiguity? Explain ambiguity in multiple inheritance and its solution with example.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

10. Write a program to handle “array index out of range” exception.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

11. Why concept of templates is important? Explain function templates with example.

5 marks
Details
Official Answer
AI Generated Answer

AI is thinking...

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 marks
Details
Official Answer
AI Generated Answer

AI is thinking...