大家查查我程序的错误在哪?
在最后要显示“yes"和"no"的时候,他要我有个"return", 我不知道要return 什么。 大家帮帮忙谢谢/*********************************************************************************
Assignment #5 project 31 Due: 10/17/2007
Name: Quan Xu
Purpose: The program will ask users to input the number of hours they have worked, and the
rate of pay per hour, then out put the gross pay for the employee. If he/she worked
over than 80 hours per week, it will display illegal.
*********************************************************************************/
#include <iostream>
using namespace std;
int displaygrosspay (int hr, int rate);
char displayillegal (int hr);
main()
{
int hour, rate_of_pay, gross, error;
cout<<"Please enter how many hours you have worked today:\n";
cin>>hour;
cout<<endl;
cout<<"Please enter the rate of pay per hour:\n";
cin>>rate_of_pay;
cout<<endl;
gross=displaygrosspay(hour, rate_of_pay);
cout<<"You have worked "<<hour<<" hours.\n";
cout<<"And got "<<rate_of_pay<<" dollars per hour.\n";
cout<<"The gross play is "<<gross<<endl;
error=displayillegal(hour);
cout<<"Overtime?\n";
cout<<error<<endl;
return 0;
}
int displaygrosspay (int hr, int rate)
/*****************************************************************************************************
Name: displaygrosspay
Purpose : calculate the employee's gross rate
Arguments: none
Return Value: gross
*****************************************************************************************************/
{
int gross;
gross=hr*rate;
return (gross);
}
char displayillegal(int hr)
/*****************************************************************************************************
Name: displayillegal message
Purpose : tell the employees if they worked overtime
Arguments: if over 80 hrs return "yes", if less than 80 hrs, return "no"
Return Value: error
*****************************************************************************************************/
{
if (hr*5>80)
{
cout<<"Yes";
}
else
{
cout<<"No";
}
}