0
#include <iostream>
using namespace std;
main()
{intx,charge;
float a,b,c;
cout<<"case 1<=2hours,case2<=3hours,case3<=4hours,case4<=5hours,case5>6hours\n";
cout<<"pls enter your time entry\n";
cin>>a;
   cout<<"pls enter your time exit\n";
   cin>>b;
   c=b-a;
   cout<<"no of hours park is\n"<<c;
   cout<<"pls enter no of case according to your no of parking hours\n";
   cin>>x;
   switch(x)
   {
       case 1:cout<< "the charge is RM2.00\n";break;
       case 2:cout<< "the charge is RM3.00\n";break;
       case 3:cout<< "the charge is RM4.00\n"; break;
       case 4:cout<< "the charge is RM5.00\n";break;
       case 5:cout<< "the charge is RM8.00\n";break;

default: cout<<"invalid hours of charge";break;
}
return 0;
}

Edited by daesung: i cannot run this pgrmm properly because it is suppose to test for Time entry Time exit 08.20 09.15 10.30 13.45 11.15 16.30 12.01 19.45

4
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by amrita111
0

OK, aside for the fact that the function header should be int main() and not just main(), what is the problem you are having?

0

ook thnks.but i still cannot run it properly because this pgrm should be test for
Time entry=08.20,10.30,11.15,12.01
time exit=09.15,13.45,16.30,19.45
can you help me to make it more correct?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.