Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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
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