Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

  1. float calcGrossPay(float salary)

return salary

  1. float calcGrossPay(float hours, float rate)

return hours * rate

  1. float calcGrossPay(float salary, float ot-hours, float ot-rate)

return salary + ot-hours * ot-rate

  1. 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]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions

Question

Understand highlights of legislation enacted in 1964 and beyond

Answered: 1 week ago

Question

Was there an effort to involve the appropriate people?

Answered: 1 week ago

Question

18. If you have power, then people will dislike and fear you.

Answered: 1 week ago