Question: Write a program that prompts the user to enter the capacity of his car's fuel reservoir in liters, the percentage of how much fuel
Write a program that prompts the user to enter the capacity of his car's fuel reservoir in liters, the percentage of how much fuel is remaining in the reservoir and the consumption rate of his car in liters per 100 Km. The program will then: Calculate the remaining fuel amount: fuel amount = capacity * remaining percentage fuel amount 100 Calculate the distance for which this fuel amount is enough: distance comsumption rate 72 The cost of refilling the car: cost (capacity-fuel amount) * 20 The program will then display all the information as shown in the sample run below Sample Run: Enter the total capacity of your reservoir in Liters: 65 Enter the percentage of the remaining fuel: 0.4 Enter the consumption rate of your car in Liters/100Km : 12.5 The remaining fuel amount is 26.0. The distance that you can travel with the current fuel amount is 208.0Km. The cost of refilling your car is : 140.4 Java langauge
Step by Step Solution
3.42 Rating (158 Votes )
There are 3 Steps involved in it
import javautilScanner public class Main public static void mainString args int total... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (2 attachments)
635f6667cc02c_231858.pdf
180 KBs PDF File
635f6667cc02c_231858.docx
120 KBs Word File
