hello to everyone i am new to this stuff so i was wondering if anyone could help me fix this error that i get on a code that is for a payroll assignment. when i build it i get this C4551: function call missing argument list. would really like the help thanks and sorry for putting the whole code i don't really know what needs to be fix, thanks again.

#include <iostream> 
#include <string> 
#include <iomanip> 
using namespace std; 
string GetName(); 
int GetHours();
double GetPayrate(); 
const double tax = .28;

double ComputeBasePay(int hours,double payRate); 
double ComputeOvertimePay(double payRate,int hours); 
double ComputeGrossPay(double basePay,double overtime);
double ComputeFederalTax(double grossPay,double tax); 
double ComputeNetPay(double grossPay,double fedtax); 
void DisplayHeading();
void DisplayColumn(); 
void DisplayLine(string name,int hours,double payRate,double basePay,double overtime,double grossPay,double fedtax,double netPay); 
bool AreThereMore(); 

int main() 
{	



string name;
int hours; 
double payRate; 
double basePay; 
double overtime; 
double grossPay;
double fedtax; 
double netPay;
 
DisplayHeading();

do 
{ 
name = GetName();
hours = GetHours();
payRate = GetPayrate();
basePay = ComputeBasePay(hours,payRate);
overtime = ComputeOvertimePay(payRate,hours); 
grossPay = ComputeGrossPay(basePay,overtime);
fedtax = ComputeFederalTax(grossPay,tax); 
netPay = ComputeNetPay(grossPay,fedtax ); 
DisplayColumn();  
DisplayLine(name,hours,payRate,basePay,overtime,grossPay,fedtax,netPay);
AreThereMore(); 

}while(AreThereMore); 

cin.get();

	return 0; 
} 

void DisplayHeading()
{
cout<<setw(50)<<right;
cout <<"Disney Employee Report \n"; 
cout<<setw(50)<<right;
cout <<"Week of April 13, 2010 \n"; 

}

string GetName() 
{ 
string Name;
cout <<"\nEnter employees's name: "; 
getline(cin,Name);
cin.ignore();

	return Name; 
} 

int GetHours()
{int hours; 
cout<<"Enter hours worked by employee: ";
cin>>hours; 
return hours; 
}

double GetPayrate() 
{ double payRate; 
cout<<"\nEnter employee's pay rate: "; 
cin>>payRate; 
return payRate; 
} 

double ComputeBasePay(int hours, double payrate) 
{ 
	double basepay;
	if (hours<=40) 
	{
		basepay=hours*payrate;
	}
	else 
	basepay=40*payrate;



return basepay; 
} 


double ComputeOvertimePay(double payRate,int hours) 
{ 
	double overtime = 0.0; 
	if (hours>40) 
	{ 
		overtime = 1.5*payRate*(hours-40);

	} 
	return overtime; 
} 

double ComputeGrossPay(double basePay,double overtime)
{ 
	double grossPay; 

grossPay = basePay+overtime; 

return grossPay;

} 

double ComputeFederalTax(double grossPay, double tax) 
{ 
	double fedtax; 
	
	if (grossPay>300) 
	{ 
		fedtax=grossPay*tax;
	} 
	else 
		fedtax = 0.00;

	return fedtax; 
} 

double ComputeNetPay(double grossPay,double fedtax)
{ 
	double netPay; 

	netPay = grossPay-fedtax; 

	return netPay; 
} 




void DisplayColumn()
{ 
	cout<<"\nEmployee name    Hours    Rate    Base    Overtime    Gross    Fedtax    Net Pay   \n"; 
} 

void DisplayLine(string name,int hours,double payRate,double basePay,double overtime,double grossPay,double fedtax,double netPay)
{ 
	
cout<<name<<setw(7)<<hours<<setw(8)
<<fixed<<showpoint<<setprecision(2)<<payRate<<setw(8)<<basePay<<setw(8)<<overtime<<setw(8)
<<grossPay<<setw(8)<<fedtax<<setw(8)<<netPay<<endl; 

} 


bool AreThereMore() 
{ 
	bool answer;  
	char reply; 
 cout<<"\nAre there more employees to process (Y or N)? ";
 cin>>reply; 

 if (reply == 'Y'||'y')
	{ 
answer=true; 
cin.ignore();
} 
	else(reply== 'N'||'n');
	{ 
cout<<"Have a nice day. Bye.";

	} 
return answer; 

}

Recommended Answers

All 7 Replies

Kindly use code tags or you will not get much help from here.

}while(AreThereMore);

The above line needs to be

}while(AreThereMore());
commented: Would have been better if you'd stopped at the "use code tags" ;) +20

The error I get is 'address of while(AreThereMore) will always evaluate to true.'

You need the ()'s when calling the function.

Also I see a couple of things in your AreThereMore() function:

If answer is not true, you need to set it to false. And when you compare you need to check each answer. Instead of

if (reply == 'Y'||'y') //this will always evaluate to true, I believe...because it is asking[I] if reply == 'Y' [/I]OR [I]if 'y'[/I]
{ 
answer=true; 
cin.ignore();
} 
else(reply== 'N'||'n');
{

You can say:

if (reply == 'Y'|| reply =='y')
{ 
answer=true; 
cin.ignore();
} 
else if(reply== 'N'|| reply =='n')
//or just put the else, without a comparison:
else{
//
}

thank you so much that helped out a lot :D

thanks so much for the helps :D

Mark the thread as solved, if your issue is resolved.

hello sorry to bother you all again when i build it is says it was a success but one i debug it it tells me this message

Debug error!
run-time check failure #3- the variable 'answer' is being used without being initialized

well, initialise it :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.