Assignment: #CommuteCalculator Due: 04/15/2017 Points: 5


This program calculates the cost of a commute. The calculation requires the following inputs.

Prompt the user to enter the aforementioned data and compute how much money per month is spent on gas.

Use int variables for all the data except for the price of gas -- use a double to store that.

The formula for this part is similar to the following:

Example Run

Note: Numbers enclosed in <angle brackets> are user inputs. Your prompts should match those used in this example.

   How many miles round-trip a day do you commute? <22>
   How many days a week do you commute? <4>
   How many weeks a year do you commute? <39>
   How many miles per gallon does your vehicle get? <23>
   What is the current per gallon price of gas? <1.21>

The program output should look as follows.

   22 miles a day
   4 days a week
   39 weeks a year
   23 miles per gallon
   $1.21 per gallon
   monthly gas expense:  $15.0461

Prompt the user if they'd like to do another cost of commute calculation. If they enter 'Y' or 'y', then repeat; otherwise, print the following and exit the program.

   This program executed X cost of commute calculations.
   Total commute miles: Y       Average commute cost: $z