I have been working with this code for at least two weeks for a class. I am wondering if anyone can show me what i am doing wrong? Will be grateful for help.
Here is my assignment to show you i am trying to accomplish:
Goals:
1. Use arithmetic operators and relational operators
2. Use const keyword to declare a constant data object
3. Use if / else and switch decision constructs
4. Develop a flow chart depicting decision structures
5. Format numerical output
Print Assessment Sheet (link)
Description:
Calculate the weekly wage for hourly employees.
Interaction:
Enter employee number: 1032864
Enter pay code ( M/O/T ): M
Enter hours worked: 41
Example Output:
Employee #: 1032864
Pay Rate: $5.15
Hours Worked: 41
Goals:
1. Use arithmetic operators and relational operators
2. Use const keyword to declare a constant data object
3. Use if / else and switch decision constructs
4. Develop a flow chart depicting decision structures
5. Format numerical output
Print Assessment Sheet (link)
Description:
Calculate the weekly wage for hourly employees.
Interaction:
Enter employee number: 1032864
Enter pay code ( M/O/T ): M
Enter hours worked: 41
Total Pay: $213.72
Input Data:
Employee Number
Hours Worked
Pay Code:
The company has three pay scales:
minimum wage - pay code 'M'
minimum plus $1.00 - pay code 'O'
minimum plus $2.00 - pay code 'T'
The current minimum wage is _________. (Use the Internet...find out.)
Test Data:
Employee
Pay Code
Hours
Pay $$
1032864
M
41
1171955
T
38
1224096
O
45
1234567
N
40
Considerations:
Employee gets time and a half for overtime over 40 hours per week. Currency values should be formatted as currency in US dollars.
Program Logic:
// initialization
(Did you remember to #include <iomanip>?
Display Programmer Name and Assignment Number.
// input
Prompt operator for Employee Number, Pay Code, and Hours.
Store all keyboard input in data objects you declared.
// processing
Use switch to assign Pay Rate a value based on Pay Code.
If Pay Code is invalid:
Assign Pay Rate a value of zero
Display an error message to operator
Use if / else to calculate pay based on hours worked:
0 to 40 hours: multiply hours times pay rate.
Over 40 hours: multiply 40 times pay rate
multiply hours over 40 by 1½ pay rate
add regular and overtime pay
// output
Set precision to round pay to nearest cent.
Display results as shown above.
// termination
Display normal end of job message
other half:
PART A: do / while loop
Goals:
Modify your pay calculation program (Lab 3) to allow an unlimited number of employees to be processed:
Prompt: "Another employee to process (Y/N) ?"
Store reply and use it to control the loop.
Count the number of employees processed without error.
Accumulate a total payroll amount.
Test Data:
Use one cin statement to read all three values.
Program Interaction:
Assignment 5A Programmed by yourname here
Enter Employee #, Pay Code, Hours:
1032864 M 41
Pay Rate: $??.?? Pay Amount: $???.??
Another employee to process (Y/N)? y
Enter Employee #, Pay Code, Hours:
1171955 T 38
Pay Rate: $??.?? Pay Amount: $???.??
Another employee to process (Y/N)? y
Enter Employee #, Pay Code, Hours:
1224096 O 45
Pay Rate: $??.?? Pay Amount: $???.??
Another employee to process (Y/N)? y
Enter Employee #, Pay Code, Hours:
1234567 N 40
INVALID PAY CODE
Pay Rate: $??.?? Pay Amount: $???.??
Another employee to process (Y/N)? n
Number of Employees Processed: ?? Total Payroll: $????.??
Normal Job Termination
and here is my code:
#include<iostream> //Header File for console I/O
#include<iomanip>