Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Computer Science II - function assignment #7 This is an example of overloading functions. Two functions are overloaded if the functions share a name but

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]

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

Step: 3

blur-text-image

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

Database And Expert Systems Applications 31st International Conference Dexa 2020 Bratislava Slovakia September 14 17 2020 Proceedings Part 1 Lncs 12391

Authors: Sven Hartmann ,Josef Kung ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

303059002X, 978-3030590024

More Books

Students also viewed these Databases questions

Question

f. Did they change their names? For what reasons?

Answered: 1 week ago