Question: In C++ Write a program that calculates the average number of days a companys employees are absent. Requirements 1. The program should have the following

In C++

Write a program that calculates the average number of days a companys employees are absent.

Requirements

1. The program should have the following functions: numEmployees, inputAbsences, printResults.

2. numEmployees function should ask the user how many employees the company has. This number should be returned to main.

3. inputAbsences function should ask the user to input the number of absences each employee has according to the number of employees.

4. printResults function should display the average number of absences for the number of employees. It should display number of employees and average number of as absences.

5. The main function should call the above 3 functions.

6. Input validation for number of employees: Do not accept a number less than 1. For number of absences: Do not accept a negative number.

7. It is your choice whether to use void functions or value-returning functions.

8. Make sure your variable names are different from the function names.

9. It is your choice where to calculate the average number of absences. Average number of absences should be carried to 1 decimal place.

10. When saving your program, include your initials: prog2XX.cpp.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!