Why do we need object oriented programming? How can we use inheritance to reuse already written and tested code in programs? Discuss with suitable example. (3+3+4)
Discuss features of class and object. Design a class to represent a bank account with data members name, account-number, account-type, and balance and functions to assign initial values, to deposit an amount, to withdraw an amount after checking balance, and to display the name and balance. (4+6)
What is operator overloading? What are the benefits of overloading? How is operator overloading different from function overloading. Write a program that shows an example of function overloading. (2+2+2+4)
Short Questions
Attempt any eight questions: (8 × 5=40)
Discuss polymorphism with example.
What is library function? How is it different from user defined function?
What is looping? Differentiate while loop with do-while loop with example.
Discuss the use of inline function with example.
What is constructor? Differentiate it with destructor.
Explain about accessing a member function outside a class with example.
Write a program that decreases an integer value by 1 (one) by overloading-operator.
Differentiate between abstract base classes and concrete classes.
What is function template? Differentiate it with class template.