1. Engineering
  2. Computer Science
  3. computer science ii function assignment 7 this is an...

Question: computer science ii function assignment 7 this is an...

Question details

Computer Science II - function assignment #7 This is an example of overloading functions. Two functions are overloaded if the functions share a name but have different parameter lists. Each of the functions will accept from one to four parameters (floats) and calculate a gross pay. The gross pay is returned to the calling function A. float calcGrossPay(float salary) return salary B. float calcGrossPay(float hours, float rate) return hours * rate C. float calcGrossPay(float salary, float ot-hours, float ot-rate) return salary + ot-hours * ot-rate D. float calcGrossPay(float hours, float rate, float ot-hours, float ot-rate) return hours * rate + ot-hours * ot-rate in main ask the user for 1. salary 2. hours 3. pay rate 4. over time hours 5. overtime rate call each of the overloaded functions with the proper arguments output (these are the numbers you read in) salary ??,???.00 hours ??.00 pay rate ???.00 over time hours ??.00 overtime rate ???.00 salary ??,???.00 // from function ‘A’ hourly pay ??.00 // from function ‘B’ salary + o/t ??,???.00 // from function ‘C’ hourly pay + o/t ??,???.00 // from function ‘D’ Use the output (cout) manipulators to format the output correctly [setw(?), fixed, right, left, etc]

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution