Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Holman Duran
- // CMSC 140
- // CRN 32727
- // Professor Najmeh Abedzadeh
- // Project 4
- // Due Date : Nov. 23rd, 2019
- #include<iostream>
- #include<iomanip>
- #include<fstream>
- using namespace std;
- void NumberOfEmployees();
- void TotDaysAbsent();
- int AverageAbsent(int);
- int total_emp, result;
- int main()
- {
- cout << "This program is designed to output data from employee information"
- << "and extract it onto a txt file. \n\nPlease note, the threshold is 10\n";
- cin >> employeeCount;
- NumberOfEmployees();
- TotDaysAbsent();
- return 0;
- }
- void NumberOfEmployees()
- {
- int employeeCount;
- while (employeeCount < 1)
- {
- cout << "\n\nError, I'm sorry I cannot process a number of employees \nless than 1 or greater than 25";
- cout << "\n\nPlease enter a valid number: ";
- cin >> employeeCount;
- return;
- }
- }
- int TotDaysAbsent(int)
- {
- int absent;
- while (employeeCount < 10)
- {
- int id_Num;
- cout << "\nEnter an employee ID: ";
- cin >> id_Num;
- cout << "\nHow many absent days does this employee have?";
- cin >> absent;
- employeeCount++;
- return absent;
- }
- }
- result = absent / total_emp;
- cout << "The annual absent is: " << result << endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement