when i run the program it skips the Int Tax(); function an i tried changing it to void an taking out return 0; but its still not working
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
char vehicle[5];
int car;
int truck;
int hrsn; //Hour the vehicle entered the parking lot
int minn; //Minute the vehicle came in the parking lot
int hrso; //Hour the vehicle left the parking lot
int mino; //Minute the vehicle left the parking lot
int hr; //final hour
int min; //final minute
int minutes_max;//60 minutes
int hours_max;//24 hours
hrsn=0;
hrso=0;
minn=0;
mino=0;
hr=0;
min=0;
minutes_max=0;
hours_max=0;
int Tax();
void main()
{
printf("Where you driving a car or truck?\n");
scanf("%s", &vehicle );
while( strcmp( vehicle, "truck" ) != 0 && strcmp( vehicle, "car" ) != 0 )
{
printf("Please input the words Car or Truck: ");
scanf("%s",&vehicle);
}
printf("What Hour did the %s enter the lot? (0-23)\n", vehicle);
scanf("%d",&hrsn);
while((hrsn<0 || hrsn>23))
{
printf("\a\a\a Please Input Value from 0-23!\n");
scanf("%d",& hrsn);
}
{
printf("What Minute did the %s enter the lot? (0-59)\n", vehicle);
scanf("%d",& minn);
}
while((minn<0 || minn>59))
{
printf("\a\a\a Please Enter Correct Minute Between 0-59!\n");
scanf("%d",& minn);
}
{
printf("What Hour did the %s leave the lot? (0-23)\n", vehicle);
scanf("%d",& hrso);
}
while((hrso<0 || hrso>23))
{
printf("\a\a\a Please Enter the Correct Time Between 0-23!\n");
scanf("%d",& hrso);
}
{
printf("What Minute did the %s leave the lot? (0-59)\n", vehicle);
scanf("%d",& mino);
}
while(mino<0 || mino>59)
{
printf("\a\a\a PLease Enter the Correct time between 0-59!\n");
scanf("%d",& mino);
}
{
if(minn < mino)
{
minutes_max = 60 - (mino - minn);
//minutes_max = 60 - 5
//minutes_max = 55 minutes
}
else if(minn > mino)
{
minutes_max = (60 - minn) + mino;
hrso = hrso-1;
}
else
minutes_max = 0; //minutes_in equals minutes_out
if (hrsn < hrso)
{
hours_max = 24 - (hrso - hrsn);
}
else if (hrsn > hrso)
{
hours_max = (24 - hrso) + hrsn;
}
else
hours_max = 0;
hours_max = (hrso - hrsn);
printf("Time in %d:%d\n", hrsn, minn);
printf("Parking Time: %d:%d \n", hours_max, minutes_max);
}
}
int Tax()
{
float gct;
float price_car;
float price_truck;
float price;
float finalprice;
price=0;
finalprice=0;
gct=0.175; //17.5%
price_car=0;
price_truck=0;
if(vehicle == "car")
{
if( minutes_max > 1 || minutes_max < 30)
{
price = price_car + 50;
}
else if(minutes_max > 30 || minutes_max < 60)
{
price = price_car + 100;
}
else if( hours_max >= 1)
{
price = (price_car+100) * hours_max;
}
finalprice = (gct * price) + price;
}
if(vehicle == "truck")
{
if( minutes_max > 1 || minutes_max < 30)
{
price = price_truck + 50;
}
else if(minutes_max > 30 || minutes_max < 60)
{
price = price_truck + 100;
}
else if( hours_max >= 1)
{
price = (price_truck+100) * hours_max;
}
finalprice = (gct * price) + price;
}
printf("The Final Price is: %f", finalprice);
return 0;
}