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 

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

1 Expert Approved Answer
Step: 1 Unlock

import javautilScanner public class Main public static void mainString args int total... View full answer

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

Document Format (2 attachments)

PDF file Icon

635f6667cc02c_231858.pdf

180 KBs PDF File

Word file Icon

635f6667cc02c_231858.docx

120 KBs Word File

Students Have Also Explored These Related Programming Questions!