Write a program that asks the user for how much gas is in their tank, and...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that asks the user for how much gas is in their tank, and what the average mileage is for their car. The program would then ask the user for the distance to their location. If they have enough gas to get there, the program would let the user know how much further they can drive. If they will not make it, the program will let them know how much further they have to go. Enter the gas (in gallons): 10 Enter the mileage your car gets (in mpg): 31 How far is your location (in miles): 300 You will reach your destination with 10 miles to spare. Write a program that asks the user for how much gas is in their tank, and what the average mileage is for their car. The program would then ask the user for the distance to their location. If they have enough gas to get there, the program would let the user know how much further they can drive. If they will not make it, the program will let them know how much further they have to go. Enter the gas (in gallons): 10 Enter the mileage your car gets (in mpg): 31 How far is your location (in miles): 300 You will reach your destination with 10 miles to spare.
Expert Answer:
Answer rating: 100% (QA)
Heres a simple Java program that accomplishes the described task import javautilScanner public class ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Due to the rapid growth of your technology company, the executive team has asked HR to develop an internal training program. The purpose of the program is to help employees recently promoted to...
-
Predictive text entry systems are familiar on touch screens and mobile phones. This question asks you to consider how the same principles might be used in a programming editor for creating Java code....
-
pthyon Carleton student ID). Add a function named find_diff() to your program that takes a 2-D list of any size containing some positive integers. Your function must find the difference between the...
-
The Moto Hotel opened for business on May 1.2017. Here is its trial balance before adjustment on May 31. Other data: 1. Insurance expires at the rate of $450 per month. 2. A count of supplies shows...
-
1.What is Valuation Concepts and methods? 2. What are the main Valuation method?
-
As the manager of an Aunty Pasta Corporation restaurant, you must deal with a variety of business transactions. Requirement 1. Give an example of a transaction that has each of the following effects...
-
The European Division of Worldwide Reference Corporation produces a pocket dictionary containing popular phrases in six European languages. Annual budget data for the coming year follow. Projected...
-
Assume the following data for Sheridan Home Appliance Repair for the payroll quarter ended March 31. Gross earnings Employee FICA taxes Federal income tax State income tax Number of employees this...
-
You own a local fast-food restaurant and are introducing a new item to your menu - Shakes! You must decide on a pricing strategy for burgers, fries, and shakes. The market you serve contains equal...
-
For the data shown in Fig. P2.2, determine the following. (a) The stick fixed neutral point. (b) If we wish to fly the airplane at a velocity of 125 ft/s at sea level, what would be the trim lift...
-
In a one dimensional problem, two boxes are heading toward each other. Box A has a mass of 20 kg and has an initial velocity of +10 m/s. Box B has a mass of 30 kg and has an initial velocity of -5...
-
A seagull can fly at a speed of 9.3 m/s in still air. a) Suppose it takes the bird 19.9 min to travel 5.94 km over the ground when flying directly into the wind (the velocity of the air over the...
-
Researching retirement savings online, you found an article from NewRetirement.com with recommendations from financial guru, Dave Ramsey and others. Dave Ramsey recommends investing 15% of every...
-
1. Discuss investing in stocks vs. bonds. Why would one be chosen over the other? 2. Discuss risk vs reward. Is there such a thing as low risk AND high reward? 3. The typical suggested portfolio is...
-
Cybersecurity: Companies Set Data Sharing To Fight Hacks Nash, Kim S . Wall Street Journal , Eastern edition; New York, N.Y. [New York, N.Y]. 11 Aug 2022: B.5....
-
Which statement BEST explains the rise of skepticism? There was no evidence for scientific concepts, like atoms. Many of the fortunetellers' predictions failed to come true. Competing ideas made the...
-
Use critical values to test the null hypothesis H0: 1 2 = 20 versus the alternative hypothesis H0: 1 2 20 by setting a equal to .10, .05, .01, and .001. How much evidence is there that the...
-
Damped free vibrations can be modeled by a block of mass m that is attached to a spring and a dashpot as shown. From Newton's second law of motion, the displacement x of the mass as a function of...
-
Determine the general solution of the differential equation dy/dx = x4 - 2y/2x Show that the solution is correct. (Derive the first derivative of the solution, and then substitute back into the...
-
In polar coordinates a two-dimensional vector is given by its radius and angle (r, e). Write a user-defined MATLAB function that adds two vectors that are given in polar coordinates. For the function...
-
Assume Knowlton Holdings Ltd. completed these long-term non-strategic investment transactions during 2020 : 1. Journalize Knowlton's investment transactions assuming the company reports any changes...
-
Suppose on February 1, 2020, General Motors paid \(\$ 41\) million for a \(40 \%\) investment in ABC Ltd., an auto parts manufacturer. Assume \(A B C\) earned net income of \(\$ 6\) million and paid...
-
Return to exercise SB-7, the Prudential Bache (PB) investment in CitiCorp bonds. Journalize the following on PB's books: a. Purchase of the bond investment on January 2, 2020. PB expects to hold the...
Study smarter with the SolutionInn App