#include
#include
#include
double calulatecharges (double);
int main ()
{
double hourse1, hourse2, hourse3, a, b, c;
cout << "please Enter 3hourse \n"<
cin >> hourse1 >> hourse2 >> hourse3;
cout << "\ncar" << setw(21) << "Hourse" << setw(21);
cout << "charge\n" << endl;
cout << "1"<
cout << setprecision(2)
<
<<(calulatecharges(hourse1))<<"\n";
a = calulatecharges(hourse1);
cout << "2"<
cout << setprecision(2)
<
<<(calulatecharges(hourse2))<<"\n";
b = calulatecharges(hourse2);
cout << "3"<
cout << setprecision(2)
<
<<(calulatecharges(hourse3))<<"\n";
c = calulatecharges(hourse3);
cout << "\nTOTAL" << setw(17) << (hourse1 + hourse2 + hourse3);
cout << setw(21) << (a + b + c);
getch();
}
double calulatecharges (double h)
{
if (h <= 3)
return 2.00;
else if (h < 16){
h -= 3;
return 2.00 + (h * 0.5);
}
else
return 10.00;
}
|
+|
نوشته شده در ساعت   توسط lovermoon
|