Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Answer this in C++ oating pont Create an application carch several car-pooling w

ID: 3871001 • Letter: A

Question


Answer this in C++

oating pont Create an application carch several car-pooling websites that calculates your daily driving cost, so that you can estimate how much money could be sa car pooling, which also has other advantages such as reducing carbon emissions and redu congestion. The application should input the following information and display the day of driving to work saved by ducing traffic user s cost a) Total miles driven per day. b) Cost per gallon of gasolinc. c) Average miles per gallon d) Parking fees per day c) Tolls per day

Explanation / Answer

// Method to calculate total cost

double costPerDay (double fuelCost, double toll, double parkFee)

{

            double cost;

            cost = toll + parkFee + fuelCost;

            return cost;

}

//Method to calculate total number of gasoline required in a day

double gasolineNum(double totalMiles, double avg)

{

            return (totalMiles/avg);

}

// Method to calculate cost of total gasoline required in a day

double gasolineCost(double numGasoline, double cost)

{

            return (numGasoline * cost);

}

main()

{

            double milesPerDay, costPerGasoline,avgMilesPerGasoline, parkingFee, tollFee, numofGasoline, costOfFuel,totalCost ;

            /* *********** Take input from user ************ */

            cout<<”Enter the input: Miles Per Day         Cost per gasoline        Avg miles per gasoline            paring Fee             Toll Fee”<<endl;

            cin>> milesPerDay>>costPerGasoline>>avgMilesPerGasoline>> parkingFee>>tollFee;

           

            numofGasoline = gasolineNum (milesPerDay, avgMilesPerGasoline);

            costOfFuel = gasolineCost ( numofGasoline, costPerGasoline);

            totalCost = costPerDay(costOfFuel, tollFee, parkingFee);

            cout<<”Total cost per day:     ”<<totalCost<<endl;

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote