Computer Science, asked by sandeepchandrasagar, 4 months ago

//Am Getting Wrong Answer as Output please can anyone reccorect it!!
//By Bhanupriya S and Devika R
#include<stdio.h>
int main()
{
float ParkingCharges,entry,exit;
int type,charge,charge1,charge2;
char model[20],car[6];
printf("\n\n****PARKING SYESTEM****\n\n");
printf("****CHARGES****\n\n");
printf("Charges for Bikes: Rs 40 per hour.\n\n");
printf("Charges for Cars: Rs 50 per hour.\n\n");
printf("Charges for Trucks: Rs 60 per hour.\n\n");
printf("---------------------\n\n");
printf("Enter the Vehicle type :\n1:Bike\n2:Car\n3:Truck\n\n");
scanf("%d", &type);
switch (type)
{
case 1: printf("\nBike\n");
break;
case 2: printf("\nCar\n");
break;
case 3: printf("\nTruck\n");
break;
default: printf("Invalid Option Please try again!");
}
{
printf("\nEnter Vehicle Model: ");
scanf("%s", &model);
printf("\nEnter Car Number: ");
scanf("%s", &car);
printf("\nEntry Time (24 hour format): ");
scanf("%f", &entry);
printf("\nExit Time(24 hour format): ");
scanf("%f", &exit);
if(type==1)
ParkingCharges=(exit-entry)*40;
if(type==2)
ParkingCharges=(exit-entry)*50;
if(type==3)
ParkingCharges=(exit-entry)*80;
printf("Parking Fee: Rs %d \n\n", ParkingCharges);
printf("***THANK YOU****\n By Bhanupriya & Devika R");
}
return 0;
}​

Answers

Answered by mandalsoumi2000
1

Explanation:

check this into 12 hr format

Similar questions