Write a program that prompts the user to enter the capacity of his car's fuel reservoir...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Answer rating: 100% (QA)
import javautilScanner public class Main public static void mainString args int total... View the full answer
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date:
Students also viewed these programming questions
-
Write a program that prompts the user to enter three strings. Compare the String objects lexicographically and print the middle-valued string. For example, if the three strings were "abcd", "wxyz",...
-
Write a program that prompts the user to enter the length from the center of a pentagon to a vertex and computes the area of the pentagon, as shown in the following figure. The formula for computing...
-
Write a program that prompts the user to enter a three-digit integer and determines whether it is a palindrome number. A number is palindrome if it reads the same from right to left and from left to...
-
When a parameter is changed, does this affect the argument that was passed into the parameter?
-
To answer this question, you will need to refer to Target Corporations annual report in Appendix B. Target did not report any accounts receivables or credit card receivables on its February 1, 2014...
-
Determine the number of classes of a histogram for 1500 observations.
-
The following information from Jefferson Company's operations is available: Required a. Prepare a multiple-step income statement. Disregard earnings per share amounts. b. Prepare a single-step income...
-
Olive Company makes silver belt buckles. The companys master budget appears in the first column of the table. Required: Complete the table by preparing Olives flexible budget for 4,000, 6,000, and...
-
1.How would you feel financing / allowing credit lines to the following customer/ potential customers ( at least two points in favour / against whichever you decide): a.A doctor with a great practice...
-
Assume the same data as in P20-15 and that Provincial Airlines Corp. has an incremental borrowing rate of 8%. Instructions Answer the following questions, rounding all numbers to the nearest dollar....
-
[4 QUESTION 2: POINTS] Using Online Visual Paradigm, develop an Activity Diagram for the below software description: "The online committee application allows a meeting attendant to view other...
-
Answer the following question about the advantages of the two different types of spreadsheet applications. i. Identify at least two advantages of using a cloud-based spreadsheet application such as...
-
Light of wavelength 5.70 x 102 nm passes through a slit of width 0.170 mm. (a) Find the width of the central maximum on a screen located 1.70 m from the slit. mm (b) Determine the width of the...
-
Identify a company that has suffered from a cybercrime within the last five years. Describe the crime and its ramifications. Provide details on which IT- and AIS-specific components failed, allowing...
-
Mike's Auto Parts and Repairs Service's income statement data for the year ended August 31, 2018, follow. (Click the icon to view the data.) Assume the ending inventory was accidentally overstated by...
-
Capital structure and the cost of capital are complex, dynamic issues, especially when considering these on an international stage. Discuss how the cost of capital is determined in segmented vs....
-
17 points eBook 10 10 10 References On October 10, the stockholders' equity section of Sherman Systems appears as follows. Common stock-$10 par value, 97,000 shares authorized, issued, and...
-
Simplify the expression. Assume that all variables are positive. 23VI1 2 V44 8
-
Write a program that prompts the user to enter a file name, then displays the frequency table of the characters in the file and displays the Huffman code for each character.
-
Find the first ten numbers greater than Long.MAX_VALUE that are divisible by 5 or 6.
-
Programming Exercise finds a convex hull for a set of points entered from the console. Write a program that enables the user to add/remove points by clicking the left/right mouse button, and displays...
-
A \(60 \mathrm{vol} \%\) tributyl phosphate (TBP) in kerosene solvent extracts \(\mathrm{Zr}\left(\mathrm{NO}_{3} ight)_{4}\) from an aqueous solution. Entering solvent is recycled from a solvent...
-
Many extraction systems are partially miscible at high concentrations of solute but close to immiscible at low solute concentrations. At relatively low solute concentrations both McCabe-Thiele and...
-
The aqueous two-phase system in Example 13-3 will be used in a batch extraction. \(7.5 \mathrm{~kg}\) of PEG solution contains protein at mass fraction \(\mathrm{x}_{\mathrm{F}}\). Use \(6.0...
Study smarter with the SolutionInn App