BIT153 Object Oriented Programming

Object Oriented ProgrammingTU Board 2080

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…

10

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.

A worked answer is on its wayMeanwhile, read the Object Oriented Programming notes for this topic.

Discussion

Loading…

More Object Oriented Programming questions

All Object Oriented Programming old questions