Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions

Question

Explain budgetary Control

Answered: 1 week ago

Question

Solve the integral:

Answered: 1 week ago

Question

What is meant by Non-programmed decision?

Answered: 1 week ago

Question

What are the different techniques used in decision making?

Answered: 1 week ago