Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that calculates the average number of days a company\'s employee

ID: 3641823 • Letter: W

Question

Write a program that calculates the average number of days a company's employees are absent. The program should have the following functions: 1) A function that asks the user for the number of employees in the company. (no parameters, returns an int). 2) A function that asks the user to enter the number of days each employee missed during the past year. (1 parameter for number of employees, returns total of days missed for all employees) 3) A function to calculate the average number of days absent (2 int parameters: number of employees and number of days, returns float storing average number of days missed.) Your program should not accept negative numbers as input: use loops to ensure this.

To get full credit you must follow the instructions on how each function should be organized.

Program output:

Test Case 1:

How many employess does the company have?
Days missed by Employee #1?
Days missed by Employee #2?
Days missed by Employee #3?
The average number of days missed per employee is 1.

Test Case 2:

How many employess does the company have?
Number of employees must be one or greater.
How many employess does the company have?
Number of employees must be one or greater.
How many employess does the company have?
Days missed by Employee #1?
Days missed by Employee #2?
Days missed by Employee #3?
Days missed by Employee #4?
The average number of days missed per employee is 11.5.

Test Case 3:

How many employess does the company have?
Number of employees must be one or greater.
How many employess does the company have?
Days missed by Employee #1?
Days missed by Employee #2?
Days missed by Employee #3?
Days missed by Employee #4?
Days missed by Employee #5?
The average number of days missed per employee is 3.

Test Case 4:

How many employess does the company have?
Days missed by Employee #1?
Days missed by Employee #2?
Days missed must be zero or greater.
Days missed by Employee #2?
Days missed by Employee #3?
Days missed must be zero or greater.
Days missed by Employee #3?
The average number of days missed per employee is 1.

Test Case 5:

How many employess does the company have?
Days missed by Employee #1?
Days missed by Employee #2?
Days missed by Employee #3?
Days missed by Employee #4?
Days missed by Employee #5?
Days missed by Employee #6?
Days missed by Employee #7?
Days missed by Employee #8?
Days missed by Employee #9?
Days missed by Employee #10?
The average number of days missed per employee is 0.

Test Case 6:

How many employess does the company have?
Number of employees must be one or greater.
How many employess does the company have?
Days missed by Employee #1?
Days missed must be zero or greater.
Days missed by Employee #1?
Days missed by Employee #2?
Days missed must be zero or greater.
Days missed by Employee #2?
Days missed by Employee #3?
Days missed must be zero or greater.
Days missed by Employee #3?
The average number of days missed per employee is 5.66667.

Explanation / Answer

I hate how cramster will removed my hard work by removing the indentation in my code, but anyway, here goes the code. #include #include // -----------------> necessary for using the system("pause"); function #include using namespace std; int NumOfEmployees() { int numWorkers; cout > numWorkers; while (numWorkers
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote