Art\'s Arts and Crafts Emporium pays its employees based on hours worked and com
ID: 3539192 • Letter: A
Question
Art's Arts and Crafts Emporium pays its employees based on hours worked and commissions earned. Write a C++ program to generate a payroll summary report.
INPUT
Input will come from 2 files. The program must interactively prompt the user for the name of each file.
The first input file will contain employee data. For each employee, the employee's name (string), ID# (int), and hourly payrate (double) will be provided. Each value will be separated by at least 1 blank space. The maximum number of employees will be 50. The maximum length of an employee name is 20 characters. Valid ID#'s range from 1-999. All input will be valid.
Sample employee data:
tom 46 7.50
saLLy 53 8.25
VaneSSA 91 5.85
The second file will contain work data and be divided into 2 parts. The first part of the file will contain data about the hours worked by employees. Each data set will consist of an ID# followed by the number of hours worked by the employee (double). If the ID# is valid (matches an employee), the hours worked for that employee should be increased by the indicated amount. Note: the data file may contain an ID# that is currently not assigned to any employee. If such a number is encountered, generate an error message that includes the unassigned ID# and the number of hours associated with it. An ID# may appear several times in this part of the file. If there are several occurrences of the same ID#, accumulate the total hours worked for that employee. This section of the input file will be terminated by a sentinel value (an invalid ID# - less than or equal to 0).
The second half of this file will consist of commissions earned data. Again, an ID# and a commission earned (double) will be provided. The program should read this data and update the total commissions earned by the employee. As with the first part of the data file, an unassigned ID# may be encountered. Appropriate error messages should be generated. The program must continue reading commissions data until the end of file is reached.
Sample terminal session:
I just need to know how to write the following part:
If there are several occurrences of the same ID#, accumulate the total hours worked for that employee.
Apparently I need to initialize the total hours work to 0.0 first but I dont know how to do the initialize part.
Explanation / Answer
you need to edit this matrix [lee@bobby keys_sum13]$ more workfile 91 10.0 11 15.0 46 8.0 91 4.5 53 20.0 91 6.75 56 40.0 -3 53 100.0 46 55.0 67 20.0 91 35.40 46 40.0 put xeros in second column you will have total hours work = 0.0
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.