Starting from:

$23

ITSE2321- Program 2 Solved

The daily driving cost is based on total miles driven per day, cost per gallon of gas, average miles per gallon, parking fees per day, and tolls per day using the formula below:

 

Daily Driving Cost = Cost Per Gallon * Total Miles Driven ÷ Average Miles Per Gallon                                    +  Parking Fees Per Day + Tolls Per Day

 

Write a program that calculates a user’s daily driving cost.  The program should ask the user for the following data and display the user’s cost per day.  Format your output to two decimal places:

 

a)   Total miles driven per day

b)   Cost of gallon of gasoline

c)    Average miles per gallon of gasoline

d)   Parking fees

e)   Tolls per day

 

Run your program two times, with the following data, and copy and paste the output to a file.

 

 
Run 1
Run 2
 

  Total miles driven per day

  Cost of gallon of gasoline

  Average miles per gallon of gasoline

  Parking fees

  Tolls per day

 
 

25

$2.25

24

$2.45

$2.50
 

40

$2.25

30

$5.00

$1.45
 

 

Create a folder named, fullname_program2.  Copy your source code and the output file to the folder.  Zip the folder and upload it to Blackboard.

 

More products