void billing(user obj)
{
float rate_per_hr,total_cost;
cout<<"\n\n--------------------------------------------------------------------------------------------------";
cout<<"\n\nBILLING\n========";
if(obj.choice==1)
{
rate_per_hr=92.25;
cout<<"\nRate per hour for Porche 911 turbo is:"<<rate_per_hr;
}
elseif(obj.choice==2)
{
rate_per_hr=85.25;
cout<<"\nRate per hour for Maruti Omni is:"<<rate_per_hr;
}
elseif(obj.choice==3)
{
rate_per_hr=105.75;
cout<<"\nRate per hour for Tata Safari is:"<<rate_per_hr;
}
elseif(obj.choice==4)
{
rate_per_hr=117.55;
cout<<"\nRate per hour for Tavera is:"<<rate_per_hr;
}
else
{
rate_per_hr=97.50;
cout<<"\nRate per hour for Tata Indigo is:"<<rate_per_hr;
}
cout<<"\n\nThe amount to be paid by the user is:";
total_cost=rate_per_hr*(obj.no_of_hrs);
cout<<total_cost<<endl<<endl;
system("pause");
cout<<"\n\nTHANK YOU";
system ("color C9");
//Why do you clear the screen here, after you've outputted the invoice?
system("cls");
//Why would you put this here?
usingnamespace std;
cout << "\t\t\t\t" << "Your invoice..." << endl;
system ("PAUSE");
}
I think you could remove that whole bolded area from the function and it might just work - unless this is a copy/paste glitch you made?