(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
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
```
You might also like to view...
Which of the following is NOT a true statement Audrey can make to Kate?
Kate had been previously having good luck controlling visibility in some simple animations by controlling the stacking order of layers. Later, she learned how to adjust the Alpha setting of an instance to control what was appearing on the stage at any given moment. However, as her animations have gotten more complex, she has turned to her friend Audrey for guidance on the use of masks to control visibility. a. When you test a Flash movie, the area outside the stage is visible. b. The stage is a type of mask. c. A mask allows an object to sit entirely on the stage but hides part of it. d. While working in Flash, you position portions of objects, shapes, and symbols located partially on the stage and partially in the work area.
The task of finding the largest number in a list can be solved in a MIMD parallel fashion using the ____ model.
A. distributed B. divide-and-conquer C. piecewise D. stepwise
Which of the following is true regarding the use of AutoFit to adjust the size of rows and columns in a table?
What will be an ideal response?
What does the first argument in the inflate method display?
A. layout parameters B. URI C. XML layout D. SDK