#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;
}
daesung 0 Newbie Poster
Schol-R-LEA 1,446 Commie Mutant Traitor Featured Poster
daesung 0 Newbie Poster
MirzaS 0 Newbie Poster
amrita111 4 Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.