Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started