Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i need this in programming c You will write a program that will Calculate some of the costs for a road trip. .Assume the user

i need this in programming c
image text in transcribed
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 MPHH . The toll rate is 5 cents a mile .The user will stop and spend S15.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 #defineCRTSECURE NO WARNINGS #include - - #define SPEEDLIMIT 78 #define TOLLRATE "es #define ENERGYCOST 15.ee //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 minutes void CalculateTime(double miles, double *tripTinePtr, nt *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); 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Experts Guide To SQL

Authors: Frank Lusardi

1st Edition

0070390029, 978-0070390027

More Books

Students also viewed these Databases questions

Question

Determine miller indices of plane A Z a/2 X a/2 a/2 Y

Answered: 1 week ago

Question

What is the growth rate of GDP per capita?

Answered: 1 week ago