It keeps giving me a Linker error in the DaysOut function and also the findAverage function. I have no idea what is wrong and I've been trying to throw in all sorts of different combinations but I just can't seem to get it compiled. Any help is appreciated
//MrBrewski99
//This program will ask the user for the amount of employees at a company and how many days each employee missed.
//It will then find the average amount of days missed and display in the main() function.
#include <iostream>
#include <iomanip>
usingnamespace std;
int numEmployees();
int daysOut();
double findAverage();
int main()
{
//double answer;
numEmployees();
daysOut();
findAverage();
double average;
cout << setprecision(2) << fixed;
cout << "The average amount of days missed was " << average << endl;
system("pause");
return 0;
}
int numEmployees()
{
int employee;
cout << "How many employees are employeed at ths company?" << endl;
cin >> employee;
return (employee);
} //end numEmployees
int daysOut(int employee)
{
int temp, absent = 0, counter = 1;
while (counter <= employee)
{
cout << "How many days was employee " << counter << " absent from work?" << endl;
cin >> temp;
absent = (temp + absent);
counter + 1;
} //end while
return (absent);
} //end daysOut
double findAverage(int employee, int absent)
{
double average ;
average = (employee / absent);
return (average);
are different from your definitions: int daysOut(int employee)
double findAverage(int employee, int absent)
Technically this means you are declaring 2 different versions of each function. In your main() you are calling the versions that you forward declared (daysOut(), no parameters) which has been declared but never defined.