Question 1
An appliance-repair company in a very poor country has just received a few used computers for
their own use. There is no IT infrastructure, internet etc. They require a program to assist in
calculating the weekly wage and work statistics for each employee. Each employee is required to
submit a list of appliances that he/she has repaired for the week and the number of hours spent on
it.
Write a C program as follows:
Your program should read in the employee's id number (int) and hourly rate for that
employee and the number of hours for each repair he/she does. Since we do not know how many
repairs an employee does, your program should prompt the user for more repair hours, for
example:
Any more repairs performed- (Y)/(N) ?
If the response is Y, then your program should repeat the process of asking for the number of
hours, and continue as stated above. If the response is N, then your program should output the
employee's id, the total number of hours the employee worked on repairs, his weekly wage
(number of hours * rate), the number of tasks performed and the employee's average number of
hours per task. After this output, your program should prompt for more employees to be
processed, for example:
Any more employees - (Y)/(N) ?
If there are more employees, then proceed to request the employee id number and repeat the
entire process regarding calculations, as stated above.
If there are no more employees, your program should output the total wages for that week.
Your program should validate the response to each question so that the user must enter Y
or N to proceed.
Your program must also be user-friendly enough to handle inputs in either lowercase or
uppercase from the user. We will be looking for the most efficient code to handle this
requirement.
Marks will be awarded for good structure, readability, indentation, good naming of variables etc
in your program.
Question 1
An appliance-repair company in a very poor country has just received a few used computers for their own use. There is no IT infrastructure, internet ete. They require a program to assist in calculating the weekly wage and work statistics for each employee. Each employee is required to submit a list of appliances that he/she has repaired for the week and the number of hours spent or it.
Write a C program as follows:
Your program should read in the employee's id number (int) and hourly rate for that
employee and the number of hours for each repair he/she does. Since we do not know how many repairs an employee does, your program should prompt the user for more repair hours, for example:
Any more repairs performed- Y/N?
If the response is Y, then your program should repeat the process of asking for the number of hours, and continue as stated above. If the response is N, then your program should output the employees id, the total number of hours the employee worked on repairs, his weekly wage (number of hours * rate), the number of tasks performed and the employees average number of hours per task. After this output, your program should prompt for more employees to be processed, for example:
Any more employees - Y/N?
If there are more employees, then proceed to request the employee id number and repeat the entire process regarding calculations, as stated above.
If there are no more employees, your program should output the total wages for that week
Your program should validate the response to each question so that the user must enter Y or N to proceed
Your program must also be user-friendly enough to handle inputs in either lowercase or uppercase from the user. We will be looking for the most efficient code to handle this requirement.
Marks will be awarded for good structure, readability, indentation, good naming of variables etc in your program.