Howdy. I need a little help with float.
Code:
/*******************************************************************************
* Name: Trip.c
* Assignment: LAB 2
* Date Written: 10/11/2007
* Course: CS133
* Purpose: Calculate usefull info for a car trip
* Sources:
*******************************************************************************/
#include <stdio.h>
main()
{
printf("Welcome to the Trip Planner! So you are ready to take a trip?"
"Let me help you plan for your fuels costs."
"==============================================================================="
"Please provide answers to the prompts below and I will"
"display a summary for you when I have computed the results."
"===============================================================================\n")
float MPG, cost, miles, gallons, Tcost;
printf("Please input your car's average miles per gallon >> ");
scanf("%f", &MPG);
printf("Please tell me the going rate for fuel (per gallon) >> $ ");
scanf("%f", &cost);
printf("Please tell me how many miles you plan to travel >> ");
scanf("%f", &miles);
gallons= miles / MPG;
Tcost= gallons * cost;
printf("You will need to purchase" %f\n, gallons "gallons of fuel");
printf("The approximate cost of fuel for your trip is: %f\n", Tcost);
printf("Thank you, please drive safely and have a nice trip!");
return 0;
}
Thats the main chuck of the source code. According to the compiler, none of my objects listed under fload are declared. Just not really sure what to do to fix all this. I'm very new at all of this!
Thanks in advanced,
Kevin