R
Richard
I got two error saying "Error 2 error C2064: term does not evaluate to a
function taking 2 arguments" from the code below. I don't understand why or
what is wrong. Can anyone tell me what I did wrong. I am to C++. Thanks
#include <iostream>
#include <iomanip>
#include <string>
//#include <stdlib>
//#include <math>
using namespace std;
//function phototype
int NumberOfEmployee (void);
int DaysOut(int);
int AverageDaysOut(int, int);
// variable declarations
//int NumberOfEmployee, TotalDaysOut, DaysOut;
//float AverageDaysOut;
void main()
{ int NumberOfEmployee, TotalDaysOut;
int AverageDaysOut;
//cout<<setprecision(2);
//cout.setf(ios::fixed | ios::showpoint);
NumberOfEmployee=NumberOfEmployee();
TotalDaysOut=DaysOut(NumberOfEmployee);
AverageDaysOut=AverageDaysOut(NumberOfEmployee, TotalDaysOut);
cout<<"The number of Employee in your company is "<<NumberOfEmployee<<endl;
cout<<"The total number of days all of your company's employee missed is
"<<TotalDaysOut<<endl;
cout<<"The average days missed for each employee is "<<AverageDaysOut<<endl;
}
int NumberOfEmployee (void)
{
int NumberOfEmployee;
cout<<"How many employees does your company has?: ";
cin>>NumberOfEmployee;
while (NumberOfEmployee < 1)
{
cout<<"Enter the number of employees greater 1: ";
cin>>NumberOfEmployee;
}
return NumberOfEmployee;
}
int DaysOut(int NumberOfEmployee)
{
int TotalDaysOut, DaysOut;
for (int count =1; count <= NumberOfEmployee; count++)
{
cout<<"How many days did employee "<<count<<" missed work during the past
year? : ";
cin>>DaysOut;
while(DaysOut < 0)
{
cout<<"Enter a positive days out: ";
cin>>DaysOut;
}
TotalDaysOut +=DaysOut;
return TotalDaysOut;
}
}
int AverageDaysOut(int NumberOfEmployee, int TotalDaysOut)
{
int AverageDaysOut;
AverageDaysOut = TotalDaysOut/NumberOfEmployee;
return AverageDaysOut;
}
function taking 2 arguments" from the code below. I don't understand why or
what is wrong. Can anyone tell me what I did wrong. I am to C++. Thanks
#include <iostream>
#include <iomanip>
#include <string>
//#include <stdlib>
//#include <math>
using namespace std;
//function phototype
int NumberOfEmployee (void);
int DaysOut(int);
int AverageDaysOut(int, int);
// variable declarations
//int NumberOfEmployee, TotalDaysOut, DaysOut;
//float AverageDaysOut;
void main()
{ int NumberOfEmployee, TotalDaysOut;
int AverageDaysOut;
//cout<<setprecision(2);
//cout.setf(ios::fixed | ios::showpoint);
NumberOfEmployee=NumberOfEmployee();
TotalDaysOut=DaysOut(NumberOfEmployee);
AverageDaysOut=AverageDaysOut(NumberOfEmployee, TotalDaysOut);
cout<<"The number of Employee in your company is "<<NumberOfEmployee<<endl;
cout<<"The total number of days all of your company's employee missed is
"<<TotalDaysOut<<endl;
cout<<"The average days missed for each employee is "<<AverageDaysOut<<endl;
}
int NumberOfEmployee (void)
{
int NumberOfEmployee;
cout<<"How many employees does your company has?: ";
cin>>NumberOfEmployee;
while (NumberOfEmployee < 1)
{
cout<<"Enter the number of employees greater 1: ";
cin>>NumberOfEmployee;
}
return NumberOfEmployee;
}
int DaysOut(int NumberOfEmployee)
{
int TotalDaysOut, DaysOut;
for (int count =1; count <= NumberOfEmployee; count++)
{
cout<<"How many days did employee "<<count<<" missed work during the past
year? : ";
cin>>DaysOut;
while(DaysOut < 0)
{
cout<<"Enter a positive days out: ";
cin>>DaysOut;
}
TotalDaysOut +=DaysOut;
return TotalDaysOut;
}
}
int AverageDaysOut(int NumberOfEmployee, int TotalDaysOut)
{
int AverageDaysOut;
AverageDaysOut = TotalDaysOut/NumberOfEmployee;
return AverageDaysOut;
}