[Solved]Input Project User Must Enter Number Employees Company User Must Enter Integers Employee E Q37167552
Input for this project:
- the user must enter the number of employees in thecompany.
- the user must enter as integers for each employee:
- the employee number (ID)
- the number of days that employee missed during the pastyear.
Input Validation:
- Do not accept a number less than 1 for the number ofemployees.
- Do not accept a negative number for the days any employeemissed.
- Be sure to print appropriate error messages for these items ifthe input is invalid.
Output: The program should display the following data:
- Each employee number (ID) and the number of days missed shouldbe written to the report file named”employeeAbsences.txt“.
- The average number of days a company’s employees are absentingduring the year should be written to the report file named”employeeAbsences.txt”.
- Create a global variable of type ofstream forthe output file. Use this variable to open thefileemployeeAbsences.txt in your program to writedata to it. A global variable is defined above the main functionand its scope is throughout the program.
- Create the following three functions that will be called by themain function:
- A function called NumOfEmployees. This function asks the userfor the number of employees in the company. This value should bereturned as an int. The function accepts no arguments (Noparameter/input).
- A second function called TotDaysAbsent that accepts anarguments of type int for the number of employees in the companyand returns the total of missed days as an int. This functionshould do the following:
-
- Asks the user to enter the following information for eachemployee:
- The employee number (ID) (Assume the employee number is 4digits or fewer, but don’t validate it).
- The number of days that employee missed during the past year.
- Writes each employee number (ID) and the number of days missedto the output file (employeeAbsences.txt). ( Referto Sample File Output )
- A third function called AverageAbsent that calculates theaverage number of days absent.
- The function takes two arguments:
- the number of employees in the company
- the total number of days absent for all employees during theyear.
- This function should return, as a double, the average number ofdays absent.
- This function does not perform screen or file output and doesnot ask the user for input.

Expert Answer
Answer to Input for this project: the user must enter the number of employees in the company. the user must enter as integers for … . . .
OR

