Design and implement an interactive program named trip.c thatcollects information about the user's car and planned travel, andreports back useful information.
The dialog below shows exactly what data should be collected asinput and reported as output.
Some Hints to get started /* Not tested not complete code Justto get you started
*/ #include
/* FUNCTION PROTOTYPES */
void WelcomeMessage();
void AskUserForInput(); /* ask and check whether user wants tocontinue if wants to continue gather information and calculate theresults (optional create more functions) */
void PrintTripSummary(float fuel, float minCost, float maxCost,float travelMiles); /* could call this from AskUserForInput(); In aloop and feed it the user input */
/* MAIN */
int main() {
/* Call the functions */
return 0;
}
You do not need to verify user input data. Presume that the userenters reasonable/correct data.
Although you might want to test the results of entering\"interesting data\" such as alpha data instead of numeric.
Below is the program output. Black is used toillustrate the output, while regular text shows user Input.
Welcome to the Trip Planner!
So you are ready to take a trip? Let me help you planfor your fuel costs and required stops to fill up your tank.============================================================
Please provide answers to the prompts below and I willdisplay a summary for you when I have computed the results.============================================================
Please input your car's average miles per gallon (enter0 to quit) >> 16
Please tell me the range of fuel costs you expect to pay(per gallon).
The lowest per gallon cost of fuel is >>4.17
The highest per gallon cost of fuel is >>5.20
Please tell me how many miles you plan to travel>> 900
=============== Trip Summary==================
You will need to purchase approximately 56 gallons offuel.
The approximate cost of fuel for your trip is between$235 and $293
=============== End Trip Summary==================
Please input your car's average miles per gallon (enter0 to quit) >> 11
Please tell me the range of fuel costs you expect to pay(per gallon).
The lowest per gallon cost of fuel is >>4.17
The highest per gallon cost of fuel is >>5.20
Please tell me how many miles you plan to travel>> 1300
=============== Trip Summary==================
You will need to purchase approximately 118 gallons offuel.
The approximate cost of fuel for your trip is between$493 and $615
=============== End Trip Summary==================
Please input your car's average miles per gallon (enter0 to quit) >> 0
Thank you, please drive safely and have a nicetrip!