Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. // Holman Duran
  2. // CMSC 140
  3. // CRN 32727
  4. // Professor Najmeh Abedzadeh
  5. // Project 4
  6. // Due Date : Nov. 23rd, 2019
  7.  
  8. #include<iostream>
  9. #include<iomanip>
  10. #include<fstream>
  11. using namespace std;
  12. void NumberOfEmployees();
  13. void TotDaysAbsent();
  14. int AverageAbsent(int);
  15. int total_emp, result;
  16.  
  17.  
  18.  
  19. int main()
  20. {
  21.  
  22. cout << "This program is designed to output data from employee information"
  23. << "and extract it onto a txt file. \n\nPlease note, the threshold is 10\n";
  24. cin >> employeeCount;
  25. NumberOfEmployees();
  26. TotDaysAbsent();
  27.  
  28.  
  29.  
  30.  
  31. return 0;
  32. }
  33.  
  34. void NumberOfEmployees()
  35. {
  36. int employeeCount;
  37.  
  38.  
  39. while (employeeCount < 1)
  40. {
  41. cout << "\n\nError, I'm sorry I cannot process a number of employees \nless than 1 or greater than 25";
  42. cout << "\n\nPlease enter a valid number: ";
  43. cin >> employeeCount;
  44. return;
  45. }
  46.  
  47. }
  48.  
  49. int TotDaysAbsent(int)
  50. {
  51. int absent;
  52.  
  53. while (employeeCount < 10)
  54. {
  55. int id_Num;
  56. cout << "\nEnter an employee ID: ";
  57. cin >> id_Num;
  58. cout << "\nHow many absent days does this employee have?";
  59. cin >> absent;
  60. employeeCount++;
  61. return absent;
  62. }
  63.  
  64. }
  65.  
  66. result = absent / total_emp;
  67. cout << "The annual absent is: " << result << endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement