Thank you in advance; also, any pointers on making the program better will be well appreciated. All that is required though, is that the numbers entered are greater than zero and actually numbers.

#include <iostream> #include <string> using namespace std; int numEmployees(); int daysMissed(int); double averageMiss(int, int); int main() { int employees; int sum; double average; cout << "This program calculates the average number of days missed by employees.\n"; employees = numEmployees(); sum = daysMissed(employees); average = averageMiss(sum, employees); cout << "Average number of days missed equals " << average << "\n"; return 0; } int numEmployees() { string invalid; int num; cout << "How many employees do you have?\n"; cin >> num; while(!(cin >> num) || num < 1) { cin >> invalid; cout << "You typed \"" << invalid << "\" instead of a positive integer." << "\n"; cout << "Please try again." << "\n"; } return num; } int daysMissed(int employees) { int count = 0; int sum = 0; int num; while(count != employees) { cout << "How many days did employee " << count+1 << " miss?"; cin >> num; if((cin >> num) && num > 0) { count++; sum = sum + num; } else { cout << "Invalid input!\n"; } } return sum; } double averageMiss(int sum, int employees) { double average = static_cast<double>(sum)/static_cast<double>(employees); return average; }