Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C++ Note: Use ctrl-c while executing a program to terminate an endless loop. Assignment Submission Submit the source code file. This program will be

In C++

image text in transcribed

image text in transcribed

image text in transcribed

Note: Use ctrl-c while executing a program to terminate an endless loop. Assignment Submission Submit the source code file. 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. Requirement 1 use constant variables to store the following values: UNION_DUES = 10.00 FICA_RATE = 0.06 OVERTIME_RATE = 1.5 FEDERAL_RATE = 0.15 STATE_RATE = 0.85 Requirement 2: The user will be asked to input their hourly rate and number of hours worked. Requirement 3: The data entered will be validated. If the data entered is invalid, then you need to prompt the user to enter correct data. The hourly rate must be between $10.80 and $15.00 inclusive (10-15). The hours worked must be between 1 and 50 inclusive (1-5). Requirement 4: The program should then calculate gross and net pay using the user input and constants provided. Requirement 5: For the hours over 40 the employee gets paid 1.5 times their rate. Requirement 6: neque 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. This sh ould be calculated as net pay (after taxes and dues) divided by total hours worked. Requirement 7: The values entered by the user should be echoed back. Please see the sample Output below to see what this looks like. Requirement 8: The results should be displayed aligned on the screen with an appropriate label preceding the value. The amounts should line up under each other after their labels (see sample output). Requirement 9: The rates used to calculate FICA, federal, and state tax should be displayed after each of the corresponding amounts. Requirement 10: The output should be formatted to two decimal points. Requirement 11: You can choose your own variable names, but the recommended formulas to use are below. If you use different formulas then please make sure that they calculate the correct value. if (hours > 40) gross = (40 * rate) + ((hours - 40) * rate * OVERTIME_RATE); else gross = hours * rate; fica federal state netpay netHourly = gross * FICA_RATE; = gross * FEDERAL_RATE; = gross * STATE_RATE; = gross - (fica + federal + state + UNION_DUES); = netPay / hours; Highly Recommended use a do-while loop to get the hourly rate. use a while loop to get the hours. Use a if-else statement to determine if the overtime formula should be applied. Use these cases to test your program: Case # Rate Worked Case # Rate Worked ------ ---- 25 9.25 12.5e (rejected) 3 15.00 15.ee 60 (rejected) 45 2 Pipe Character Reminder: The Or operator is two pipe characters next to each other. Where is the pipe character on the keyboard? on most keyboards: It is right above the Enter key Shares the key with the back slash- Must hold the shift key go get it Instead of a solid line, it is shown as a broken line For the or operator, 2 pipe characters must be entered - II. Output Reminder: If execution does not pause so that the output can be reviewed, be sure to select start without Debugging from the Debug menu. Sample Output: Note: Your program does NOT need to display the "case 1 rejected" message. It has been added to this sample output to point out what is to occur. DO NOT add Logic to your program that will make it go all the way back to the beginning of the program. After a case is rejected, simply enter the hourly rate or hours worked for the next case as presented in the sample output below. PO3 - Your Name TR 1:00pm Enter a value between $10 and $15.ce for the hourly rate: 15 Enter a value between 1 and 50 for the hours worked: 68 Enter a value between 1 and se for the hours worked: 45 (case 3 rejected) Hourly Rate: Hours Worked: Gross Pay: FICA Tax: Federal Tax: State Tax: Union Dues: Net Pay: Net Hourly: 15.0 45 712.50 42.75 at 9.86 106.88 at 8.15 35.63 at 0.25 10.88 517.25 11.49 Thank you! Pseudocode: //Pe3 Your Name 1/Brief description of program, data validation, and overtime #include using namespace std; int main() { //declare constants //declare variables // set decimal formatting cout 15.80); //initialize hours to zero while (hours 50) { 1/prompt for and get hours } // calculate gross if (hours > 40) gross = (40 rate ) + (hours - 40). rate OVERTIME_RATE; else gross - hours rate; 1/calculate taxes, netPay, and netHourly 1/display the results return ; } //end of main //end of page

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 Systems An Application Oriented Approach Complete Version

Authors: Michael Kifer, Arthur Bernstein, Richard Lewis

2nd Edition

0321268458, 978-0321268457

More Books

Students also viewed these Databases questions

Question

13. You always should try to make a good first impression.

Answered: 1 week ago