Question: Using a Scanner object, request the following three double values from the user after a user - friendly output statement or prompt for each: Number
Using a Scanner object, request the following three double values from the user after a userfriendly output statement or prompt for each:
Number of gallons of gas in the tank
Fuel efficiency of the car in miles per gallon
Price of gas per each gallon
Compute how far, in miles, the vehicle can travel on the available fuel. Your program should output:
You are able to travel XXX miles on remaining fuel.
where XXX is the miles distance you calculated.
Compute how much the cost would be for the gas to travel miles. Your program should output:
It will cost $XXXX to travel miles in the vehicle.
where XXXX is the cost to travel miles.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
