int main(int argc, char *argv[])
{
float hours,charge=0;
cout<<"Enter your total hours (Enter -1 to exit): ";
cin>>hours;
while (hours!=-1)
{
cout<<"The amount of charge is: RM"<<calcCharges(hours)<<endl<<endl;
charge=calcCharges(hours);
calcTotal(charge);
cout<<"The total amount of charge is: RM"<<charge<<endl;
cout<<"Enter your total hours: ";
cin>>hours;
}
system("PAUSE");
return EXIT_SUCCESS;
}
float calcCharges(float value1)
{
float charge=0;
if (value1<=1)
charge=1.00;
else if (value1>1 && value1<=19)
charge=1+((value1-1)*0.50);
else
charge=10;