subject

Complete the following classes based on the instructions to achieve polymorphism for this exercise. Employee class (employee. h/.cpp) Employee class is an abstract class. You will need to add a string getTaxes(); function as a pure virtual function. Additionally, you may need to make some function in Employee virtual (check derived classes SalaryEmployee and Hourly Employee to see what functions have been overwritten or need to be virtual to achieve the correct behavior). 5 point will be deducted for every function that does NOT need to be virtual if it is virtual in the submission. SalaryEmployee class (salaryEmployee. h/.cpp) Salary Employee is a derived class of Employee. Please declare the following functions in the Salary Employee class (salary Employee. h) and provide their respective implementation (in salaryEmployee. cpp), respectively. • string getTaxes(): This function returns as a double the taxes that the employee has to pay, equal to 25% of the year salary. • string getEmployeelnfo(): This function returns the following string: , SSN: <33n>, year salary: SalaryEmployee destructor. This destructor will output a message Salary data destroyed. HourlyEmployee class (hourlyEmployee. h/.cpp) HourlyEmployee is a derived class of Employee. Please declare the following functions in the HourlyEmployee class (hourlyEmployee. h) and provide their respective implementation (in Hourly Employee. cpp), respectively. • string getTaxes(); This function returns as a double the taxes that the employee has to pay. For an hourly employee, this number is Oif they worked less than 100 hours, and 30% of the income (as wage* hours) otherwise. • string getEmployeelnfo(): This function returns the following string: , SSN: , salary (this month): • HourlyEmployee destructor. This destructor will output a message Hourly data destroyed. taxCollector function (main. cpp) the taxCollector function has to be implemented in the main file, and allows to compute the taxes to be paid by a group (array) of employees of various type. The function takes as input an array of pointers of type Employee and the size of the array. It then iterates through the array to compute and add together the taxes paid by each employee, and returns this number. Hint: since you are working with an array of pointers, consider what would be the best operator to access the getTaxes function (or ->). The main is commented in the initial template to allow you to test the classes first (Test cases 1-6). After passing these test cases, uncomment the main. Uncommenting the main while your classes are still incomplete may lead to compiler errors.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 21:00
If you have a lien on your vehicle, you cannot apply for a duplicate copy of your vehicle’s certificate of title. true or false
Answers: 1
question
Computers and Technology, 22.06.2019 10:00
Jackson is teaching the decimal number system. he wants his students to know how to expand numbers by powers of 10. which is the correct order in which digits are assigned values in the decimal number system?
Answers: 1
question
Computers and Technology, 22.06.2019 21:30
Im doing this last minute and literally none of my neighbors or people that my dad works with use excel so if anyone could me make up an example
Answers: 1
question
Computers and Technology, 23.06.2019 02:30
Experimental data that is expressed using numbers is said to be
Answers: 1
You know the right answer?
Complete the following classes based on the instructions to achieve polymorphism for this exercise....
Questions
question
Mathematics, 12.10.2019 21:30
Questions on the website: 13722367