Computers and Technology

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.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 12:30, zaratayyibah
Which of the choices sean are not true when considering virus behavior
Answers: 1
image
Computers and Technology, 22.06.2019 14:00, michelle7511
Which database model is best used for data warehouse and data mining
Answers: 3
image
Computers and Technology, 22.06.2019 15:10, passions3534ovf6dt
Which activity should be part of a long-term plan to positively affect yourhealth? oa. wearing regular clothing when handling toxinsob. not worrying about secondhand smokeoc. avoiding excessive exposure to sunlightod. drinking only well water
Answers: 1
image
Computers and Technology, 23.06.2019 09:30, nsjcbdhcb
Light travels at a speed of 186,000 miles a second. the distance light travels in a year is 5,865,690,000,000 miles/year 5,865,695,000,000 miles/year 58,656,950,000,000 miles/year 6,789,000,0000 miles/year
Answers: 1
Do you know the correct answer?
Complete the following classes based on the instructions to achieve polymorphism for this exercise....

Questions in other subjects:

Konu
Mathematics, 06.03.2020 23:12
Konu
Mathematics, 06.03.2020 23:12