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
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