What is constructor? Explain its types with suitable example. How is the constructor called in a derived class in C++?
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.
What is operator overloading? Write a complete C++ program to overload + operator to add two objects of class 'Time'.
Attempt any Eight questions
[8x5=40]What is the difference between public, private and protected inheritance in C++?
What is exception handling? Explain types of exception handling and explain with suitable example.
What is friend function? Write a program to add private member of two different classes using friend function.
Write a program to demonstrate returning object from functions in C++.
How 'this' pointer is used to resolve name conflict between local variable and member variable in C++? Explain with example.
Write a Program to read and write values through object using File Handling.
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.
Differentiate between function overloading and function overriding in C++.
Illustrate the use of static variable with a simple program.