Question: Research several car - pooling websites. Create an application that calculates your daily driving cost, so that you can estimate how much money could be

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 carpooling, which also has other advantages such as reducing carbon emissions and reducing traffic congestion. The application should input the following information and display the users cost per day of driving to work:
Toll road miles driven per day
Non-toll road miles driven per day
Cost per gallon of gasoline
Average miles per gallon
Parking fees per day
Tolls per mile.
However, if the number of toll road miles per day is zero do not prompt and input Tolls per mile.
Ex:
Enter toll road miles driven per day:
10
Enter non-toll road miles driven per day:
25
Enter cost per gallon of gasoline:
3.49
Enter average miles per gallon:
26.7
Enter parking fees per day:
10
Enter tolls per mile:
0.35
Daily Savings $ 18.07
Note: use int data type for toll road miles per day and non-toll road miles per day and double for all other values.
To input double value use the method nextDouble() of a Scanner.
This lab will require use of an if statement to conditionally execute the statements to input the tolls per mile. Use this if statement:
if (tollRoadMiles >0){
// place the statements to be conditionally executed here
}
Of course use the variable name you have for toll road miles, if not named tollRoadMiles

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!