Object Oriented Programming Model Question
Section A
Attempt ANY TWO [10 ×2=20]
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.
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
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.
AI is thinking...
Section B
Attempt ANY EIGHT [5 ×8=40]
AI is thinking...
4. What is meant by default argument? Explain with suitable example.
AI is thinking...
5. What are the uses of this pointer? Discuss its concept with suitable example.
AI is thinking...
6. What is destructor? Discuss its characteristics with suitable example.
AI is thinking...
7. Write a program to convert floating point value to object of distance class with data
members feet and inch.
AI is thinking...
8. How late binding differs from early binding? How can you achieve dynamic
polymorphism? Explain with example.
AI is thinking...
9. What is meant by ambiguity? Explain ambiguity in multiple inheritance and its solution
with example.
AI is thinking...
10. Write a program to handle “array index out of range” exception.
AI is thinking...
11. Why concept of templates is important? Explain function templates with example.
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.
AI is thinking...