int employeeNum;
employeeNum = getEmployeeNumber();
fileAndEmployees (outFile, employeeNum);
outFile.close();
return 0;
}
int getEmployeeNumber()
{
int employeeNumber;
cout << "Please enter the number of employees in the company: "<<endl;
cin >> employeeNumber;
return employeeNumber;
}
int fileAndEmployees(ofstream& outFile, int employees)
{
outFile << employees;
for (employees = 1; employees < 5; employees++);
{
int idNumber;
cout << "Please enter an employee ID: "<<endl;
cin >> idNumber;
int daysAbsent;
cout << "Please enter the number of days this employee was absent: "<<endl;
cin>> daysAbsent;
return employees;
}
}
and this is the result:
Please enter the number of employees in the company:
5
Please enter an employee ID:
123
Please enter the number of days this employee was absent:
2
Program ended with exit code: 0