Question
Program 3. Decisions Due: Friday, February 7 by 11:59 PM Overview For this program, design a wage calculator for a single user. The program will
Program 3. Decisions Due: Friday, February 7 by 11:59 PM
Overview
For this program, design a wage calculator for a single user. The program will use the user's number of hours worked and their hourly wage to calculate:
- Gross Pay
- Deduction
- Net Pay
The Gross Pay is the amount that the user is paid before any deduction is applied. The pay amount is based upon the number of hours worked. If 40 hours or less were worked, the gross pay is equal to number of hours worked times the hourly wage. If more than 40 hours were worked, the gross pay is equal to the pay for the first 40 hours worked plus overtime pay, which is for any hour over 40 and is paid at 1.5 times the hourly wage for each hour over 40.
The Deduction is based on the user's gross pay. If the user earned $100.00 or less, the deduction is 2% of the gross pay. If the user earned between $100.01 and $500.00, the deduction is 5% of the gross pay. If the user earned $500.01 or more, the deduction is 9% of the gross pay.
The Net Pay is equal to the gross pay minus any deduction.
Basic Program Logic
The program should ask the user for the number of hours that they worked (integer) and their hourly wage (float or double).
Using a decision statement, calculate the gross pay for the user.
Using a second decision statement, calculate the user's deduction.
Calculate the net pay for the user.
Finally, display the wage information in a table. It should include the number of hours worked, hourly wage, gross pay, deduction, and net pay.
Program Requirements
-
At the top of the C++ source code, include a documentation box that resembles the one from programs 1 and 2. This will be a part of every program that is submitted during the semester and this will be the last reminder in the program write-ups.
-
Include line documentation. There is no need to document every single line, but logical "chunks" of code should be preceded by a line or two that describes what the "chunk" of code does. This will also be a part of every program that is submitted for the remainder of the semester.
-
The dollar amounts should all be displayed with exactly 2 digits after the decimal point, including zeros.
-
Make sure and test the program with values other than those in the sample output.
-
Hand in a copy of the source code (CPP file ONLY) using Blackboard.
Output
A few runs of the program should produce the following results:
Run 1
How many hours did you work? 57 How much are you paid per hour? 5.75 Wage Calculator Hours Worked 57 Hourly Wage 5.75 --------------------------------- Gross Pay 376.62 Deductions 18.83 --------------------------------- Net Pay 357.79
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started