Question: This is for C++ This program will be used by employees to determine what their weekly net pay would be based on their hourly rate

This is for C++ This program will be used by employees to determine what their weekly net pay would be based on their hourly rate and number of hours worked. Use constant global variable to store the following value: OVERTIME_RATE = 1.5 Use constant local variables to store the following values: UNION_DUES = 10.00 FICA_RATE = 6% (0.06) FEDERAL_RATE = 15% (0.15) STATE_RATE = 5% (0.05) The user will be asked to input their hourly rate and number of hours worked. The data entered will be validated. The hourly rate must be between $10.00 - $15.00 inclusive (10-15). The hours worked must be between 1 and 50 inclusive (1-50). The program should then calculate gross and net pay using the user input and constants provided. For the hours over 40 the employee gets paid 1.5 times their rate. In addition, the net hourly rate will also be calculated and displayed, so that employees will know what their take-home pay per hour is. The results should be displayed on the screen with an appropriate label preceding the value. The amounts should line up under each other after their labels (see sample output). The rates used to calculate FICA, federal, and state tax should be displayed after each of the corresponding amounts. The output should be formatted to two decimal points. Requirements: Source code file and sample output for each case. You can choose your own variable names, but the function prototypes to use are: double inputRate(); int inputHours(); double calcGross(double rate, int hours); double calcTax(double gross, double taxRate); Define the calcTax function so that all three taxes can be calculated by calling the same function three times: fica = calcTax(gross, FICA_RATE); federal = calcTax(gross, FEDERAL_RATE); state = calcTax(gross, STATE_RATE); Use these cases to test your program: Case # Rate Worked Case # Rate Worked ------ ----- ---- ------ ----- ---- 1 12.50 40 2 15.00 45 Sample Output: P05 - Your Name Enter a value between $10 and $15.00 for the hourly rate: 12.50 Enter a value between 1 and 50 for the hours worked: 40 Hourly Rate: 12.50 Hours Worked: 40 Gross Pay: 500.00 FICA Tax: 30.00 at 0.06 Federal Tax: 75.00 at 0.15 State Tax: 25.00 at 0.05 Union Dues: 10.00 Net Pay: 360.00 Net Hourly: 9.00 Thank you! Press any key to continue P05 - Your Name Enter a value between $10 and $15.00 for the hourly rate: 15 Enter a value between 1 and 50 for the hours worked: 45 Hourly Rate: 15.00 Hours Worked: 45 Gross Pay: 712.50 FICA Tax: 42.75 at 0.06 Federal Tax: 106.88 at 0.15 State Tax: 35.63 at 0.05 Union Dues: 10.00 Net Pay: 517.25 Net Hourly: 11.49 Thank you! Press any key to continue Pseudocode: //function prototypes double inputRate(); int inputHours(); double calcGross(double rate, int hours); double calcTax(double gross, double taxRate); void main() { }//end of main //function definitions double inputRate() { double rate; do { prompt for and get rate }while(rate is not valid) return rate; } int inputHours() { int hours; do { prompt for and get hours }while(hours are not valid) return hours; } double calcGross(double rate, int hours) { double gross; if hours > 40 gross = overtime rate else gross = straight time return gross; } double calcTax(double gross, double taxRate) { double amount; amount = gross * taxRate; return amount; } 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!