Question: You will write a program that will Calculate some of the costs for a road trip . Assume the user will drive an average of

 You will write a program that will Calculate some of thecosts for a road trip . Assume the user will drive an

You will write a program that will Calculate some of the costs for a road trip . Assume the user will drive an average of 70 MPH . The toll rate is 5 cents a mile . The user will stop and spend $15.00 every 4 hours for food and/or coffee The user will enter the number of miles, the cost of gas per gallon, and the miles per gallon(mpg) of the car. You must have at least 7 user defined functions as follows: //Road trip //preprocessor directives #defineCRTSECURENOWARNINGS #include ---- #define SPEEDLIMIT 70 #define TOLLRATE .05 #define ENERGYCOST 15.00 //Greet the user void Greeting); //Calculations for one road trip void OneRoadTrip); //get input (y or n) to continue void GetYesorNo (char *inputPtr); //Calculate the cost of the gas void CalculateGasCost (double miles, double *gasCostPtr); //calculate the time in hours and minute:s void CalculateTime (double miles, double *tripTimePtr, int *hoursPtr, int *minutesPtr); //calculate the cost of food/energy void CalculateEnergyCost(double tripTime, double *foodCostPtr); //calculate cost of tolls and return the total cost of gas, tolls, and food double CalculateCost (double miles, double gasCost, double foodCost, double tollCostPtr); Additional Requirements Use function prototypes Write comments for each function that will appear in the file before each prototype and again before each function definition Be sure to comment your code adequately Be sure to indent properly. Check your textbook examples to see how it should be done Use meaningful variable names . . . NO Late Submission

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!