Answer to Question #153925 in C++ for NEELESH

Question #153925

Parking lot charges rs.30.00as a minimum fee to park a vehicle for upto 3hours.an additional charge of re 5.00 per hour will be added if exceed three hours.for 24hours the parking fee are 80.00 write a program to define an array and read the vehicle registration bumber,and hiurs parked for each customer and calculate the parking for n customer and display the output


1
Expert's answer
2021-01-06T05:15:15-0500
#include<iostream.h>
int main(){

int rs[10],hours[10],cars[10];
for(int i=1;i<=10;++i){
cout<<"Enter number car number"<<endl;
cin>>cars[i];
cout<<"Enter parking hours"<<endl;
cin>>hours[i];

if(hours[i]<=3){

rs[i]=30;
cout<<rs[i]<<endl;

}
if(hours[i]>3 && hours[i]<24){

rs[i]=30+(hours[i]-3)*5;
cout<<rs[i]<<endl;

}
if(hours[i]==24){

rs[i]=80;
cout<<rs[i]<<endl;

}

}

return 0;}











Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog