Question: Need java code please Write a program that uses a Scanner to ask the user for the gallons of gas in their gas tank. Read

Need java code please
Need java code please Write a program that uses a Scanner to

Write a program that uses a Scanner to ask the user for the gallons of gas in their gas tank. Read in the user response as a double. Then write a loop that repeatedly decreases the gallons value by 0.1. The loop should stop when gallons becomes zero or less. And you must use an if statement inside the loop to print "Low Fuel" each time the gallons value is below 10% of the original given gallons value. You will need an additional variable to store a copy of the original amount. You may choose to print the percent of the original amount on each iteration of the loop

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!