Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Hands-On Database

Authors: Steve Conger

2nd Edition

0133024415, 978-0133024418

More Books

Students also viewed these Databases questions

Question

3. Review the evidence. Do you believe the testimony presented?

Answered: 1 week ago

Question

1. What are the marketing implications of this situation?

Answered: 1 week ago