Can someone please aid me in finding solutions and help fixing the errors in my program.
The object is to calculate a parking fee with various vehicle types at different times.
Any help is appreciated.
Code:
#include <stdio.h>
#include <stdbool.h>
/* Constants */
#define car 5 /* vehicle */
#define motorbike 2 /* vehicle */
#define truck 10 /* vehicle */
/* function prototypes */
char validateVehicleType(int c, int m, int t);
float validateParkingTime(float h);
float getParkingFee(int c, int m, int t, float h);
float displayParkingFee(int c, int m, int t, float h);
int main (void)
{
/* declare variables */
float h; /* hrs */
/* Validate vehicle type. */
printf("Enter your vehicle type:");
scanf("%c");
/* Display vehicle type */
if ( vehicle type == c || m || t)
printf("%d\n");
else if ( vehicle type != c || m || t)
printf("Wrong vehicle type");
/* Validate parking time */
printf("Enter parking time (hours):");
scanf("%f", &hrs);
/* Display parking time */
if ( parking time >= 0.0)
printf("%f\n");
else if ( parking time < 0.0)
printf("Wrong parking time");
/* Get parking fee */
parking_fee = getParkingFee(int c, int m, int t, float h);
/* Display parking fee */
printf("Parking_fee = %.2f\n", dollars);
}
/* function definitions */
float displayParkingFee(int c, int m, int t, float h);
{
return ((c || m || t)*h);
if (h>4 && h<=12)
return("(parking_fee)*0.75 %.2f\n", dollars);
else if (h>12)
return("(parking_fee)*0.5 %.2f\n", dollars);
else if (h<4)
return(0);
}