Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use C++ to do this program, and please follow the structure chart provided in the program. Enter an employee's information by the order of ID
Use C++ to do this program, and please follow the structure chart provided in the program.
Enter an employee's information by the order of ID number, rate, hours: -1239 80 8.5 67 You must enter a nan negative value. Try again! 123980 8.5 67 Problems Write a program that calculates gross wages for employees. The program should ask the user to enter an employee's ID, hours worked and hourly pay rate. It should then calculate the gross wage for that emploxes and store it with this employee's information into a file. The program should use the following functions to process employee data: void getEmployee Infor() should ask the user for an employee's ID, pay rate and the hours worked. double calcWage() should calculate one employee's gross wage. void printWagea should print an employee's ID, pay rate, hours worked and wage into a file. These functions are called repeatedly to calculate wages as many times as the user wants. Input Validation: Do not accept negative values for pay rate and hours worked. Do you want to calculate another employee's gross wage? The result is reported to the file "employeeilages.dat" The file employesWages.dat" should have a similar format as follows: Input ID Hourly Rate Hours Wage Employee's id, rate and hours worked. Output Employee's information including ID, hourly rate, hours worked and calculated gross wage in a file. An Example of Test Run The output of your program might look like this: 123450 123123 123980 12.50 25.50 8.50 80.00 89.50 67.00 1000.00 2282.25 569.50 cacia.out Requirements 1. Design your algorithm FIRST. 2. Develop a structure chart for the program that solves the problem. 3. Write the program according to the structure chart in ster 1 and 2. The program should include the main function and other functions. 4. The output file must be opened in the main function and passed as a reference parameter to the function printtages, as follows: Enter an employee's information by the order of ID number, rate, hours 123450 12.5 -80 You must enter a nendegative value. Try again! 123 -12.5 80 You must enter a non negative value. Try again! 123450 12.5 80 void printWagea (ofstream SoutFile, ...) Do you want to calculate another employee's gross wage? x The file is closed at the end of the main program. See an example about this requirement at the end of this document. 5. The output format should be same as the example shown above. 6. Insert comments in the program so that it can be read easily. Don't forget to include your name, your startID, section number, file location and a description of the purpose of this program on the top of your program. Enter an employee's information by the order of ID number, tate, hours: : 123123 25.5 89.5 Do you want to calculate another employee's gross wage? x
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