Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ PROGRAMMING Days Out Write a program that calculates the average number of days a companys employees are absent. The program should have the following

C++ PROGRAMMING

Days Out Write a program that calculates the average number of days a companys employees are absent. The program should have the following functions: A function that asks the user for the number of employees in the company. This value should be passed by reference to the function. Function prototype: void GetNumEmployees(int&); A function that accepts one argument: The number of employees in the company. The function should ask the user to enter the number of days each employee missed during the past year. Keep track of the total number of days missed. This value should be returned as an int. (Hint: You will need a for loop) Function prototype: int TotalDaysMissed(int); A function that takes two arguments: the number of employees in the company and the total number of days absent for all employees in the company during the year. The function should return, as a float, the average number of days absent. (No output or user input) Function prototype: float AverageDaysMissed(int,int); Input validation: Do not accept a number less than 1. Do not accept a negative number for the days missed.

Function Definitions: a) GetNumEmployees b) TotalDaysMissed c) AverageDaysMissed

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions

Question

=+2 Is the decision sustainable in the long run?

Answered: 1 week ago

Question

=+1 Is the decision fair to employees?

Answered: 1 week ago