Question: 2. Gasoline.java: Write a program that reads the following inputs, in this order: a. minutes: the number of minutes a car is driven on a

2. Gasoline.java: Write a program that reads the following inputs, in this order: a. minutes: the number of minutes a car is driven on a long track b. mph: the constant speed of the car, given in miles per hour c. mpg: the fuel efficiency of the car, given in miles per gallon The program computes and prints the number of gallons of gasoline consumed by a car driven down a long track over the given time period. Use double division. Examples: Enter the number of minutes: 75 Enter the constant speed of the car (m/h):35.2 Enter the fuel efficiency of the car (m/g):20.6 Consumed gas for the period (in gallons): 2.1359223300970873 Enter the number of minutes: 60 Enter the constant speed of the car: 60 Enter the fuel efficiency of the car: 30 Consumed gas for the period (in gallons): 2.0 Enter the number of minutes: 164.3 Enter the constant speed of the car: 45.2 Enter the fuel efficiency of the car: 19.41 Consumed gas for the period (in gallons): 6.376747381075049 Hint: minutes /60mph1/mpg
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
