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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 18:00, alexj29227405
Write a method named addall that could be placed inside the hashintset class. this method accepts another hashintset as a parameter and adds all elements from that set into the current set, if they are not already present. for example, if a set s1 contains [1, 2, 3] and another set s2 contains [1, 7, 3, 9], the call of s1.addall(s2); would change s1 to store [1, 2, 3, 7, 9] in some order. you are allowed to call methods on your set and/or the other set. do not modify the set passed in. this method should run in o(n) time where n is the number of elements in the parameter set passed in.
Answers: 2
image
Computers and Technology, 23.06.2019 01:10, brooklynneramos9956
Problem 1 - hashing we would like to use initials to locate an individual. for instance, mel should locate the person mark e. lehr. note: this is all upper case. generate a hash function for the above using the numbers on your telephone. you know, each letter has a number associated with it, so examine your telephone keypad. generate 512 random 3 letter initials and take statistics on a linked list array size 512 to hold this information report how many have no elements, 1 element, 2 elements, does this agree with the hashing statistics distribution?
Answers: 1
image
Computers and Technology, 23.06.2019 11:00, jolleyrancher78
What are the possible consequences of computer hacking? what is computer piracy? describe some examples. what are the effects of computer piracy? what are the possible consequences of computer piracy? what is intentional virus setting? describe some examples. what are the effects of intentional virus setting? what are the possible consequences of intentional virus setting? what is invasion of privacy? describe some examples. what are the effects of invasion of privacy? what are the possible consequences of invasion of privacy? what is an acceptable use policy and what is the purpose of the acceptable use policy what is intellectual property and how can you use it?
Answers: 1
image
Computers and Technology, 23.06.2019 15:00, herchellann302
To check whether your writing is clear , you can
Answers: 2
You know the right answer?
Complete the following classes based on the instructions to achieve polymorphism for this exercise....

Questions in other subjects:

Konu
History, 18.10.2020 14:01