(Car-Pool Savings Calculator) Research several car-pooling websites. Create an application that calculates your daily driving cost, so that you can estimate how much money could be saved by car pooling, which also has other advantages such as reducing carbon emissions and reducing traffic congestion. The application should input the following information and display the user’s cost per day of driving to work:

a) Total miles driven per day.
b) Cost per gallon of gasoline.
c) Average miles per gallon.
d) Parking fees per day.
e) Tolls per day.

```
#include // allows program to perform input and output
using namespace std; // program uses names from the std namespace

int main()
{
// variables to store statistics
int miles, cost, mpg, parking, tolls;

// prompt user for each variable and read it in
cout << "Enter miles driven per day: ";
cin >> miles;
cout << "Enter cost per gallon of gas (in cents): ";
cin >> cost;
cout << "Enter average miles per gallon: ";
cin >> mpg;
cout << "Enter parking fees per day (in dollars): ";
cin >> parking;
cout << "Enter tolls per day (in dollars): ";
cin >> tolls;

// calculate their daily cost in dollars
int total = miles * cost / mpg / 100 + parking + tolls;

// display cost
cout << "\nYour daily driving cost is: " << total << endl;
} // end main
```

Computer Science & Information Technology

You might also like to view...

Based on your analysis, what do you recommend Booker Publishing focus on in terms of their competitive strategy?

What will be an ideal response?

Computer Science & Information Technology

If the size of a text field is set to 30 and the user enters 40 characters, 10 characters will not display

Indicate whether the statement is true or false

Computer Science & Information Technology