Write a java program..WAP to accept vehicle number and number of hours the vehicle is parked in the parking lot. Calculate the bill amount if the parking charge per hour is Rs 5.
Answers
Answered by
1
Answer:
c language
Explanation:
#include<stdio.h>
void main()
{
int car=10,bus=20,bi=5,noofhours,fine=0;
char n;
printf("Please enter vehicle details c-car b-bus and B-bicycle");
scanf("%c",&n);
printf("Please enter no of hours");
scanf("%d",&noofhours);
if(n=='c')
{
fine=car*noofhours;
}
else if(n=='b')
{
fine=bus*noofhours;
}
else if(n=='B')
{
fine=bi*noofhours;
}
printf("%d",fine);
}
Similar questions