Java Convert the QuartsToGallons program to an interactive application. Instead of assigning a value to the...

Question:

Java

Convert the QuartsToGallons program to an interactive application. Instead of assigning a value to the number of quarts, accept the value from the user as input.

Given program:

public class QuartsToGallons {
public static final int QUARTS_IN_GALLON = 4;

public static void main(String[] args) {
int quartsNeeded=18;
// finding required quarts
System.out.println("A job that needs " + quartsNeeded + " quarts requires " + (quartsNeeded/QUARTS_IN_GALLON) + " gallons plus "
+ (quartsNeeded % QUARTS_IN_GALLON) + " quarts");
}
}

Similar Solved Questions

The two nitrogen atoms in an N2 molecule are separated by about 110pm. (pm =picometers) Estimate...
The two nitrogen atoms in an N2 molecule are separated by about 110pm. (pm =picometers) Estimate the energy difference between the rotational ground state and the first excited rotational state of the N2 molecule.Express your answer in both Joules and in electron Volts....
The Laplace transform of the following time function f (t) = 2t2 + e-2t sin 3t...
The Laplace transform of the following time function f (t) = 2t2 + e-2t sin 3t is...
(a) Determine the maximum compressive and tensile normal stresses in the A-36 structural steel beam shown...
(a) Determine the maximum compressive and tensile normal stresses in the A-36 structural steel beam shown and define their locations (location along the beam and on the cross section). (b) Determine the deflection of point B using the double integration method. The height of the cross section shown ...
 ) 6. Let X ,X2,...,X, be a rs from N(4,4) distribution. Find the MLE of...
 ) 6. Let X ,X2,...,X, be a rs from N(4,4) distribution. Find the MLE of u. 1 (x; – u)? (Hint: f(x;)= 1210 -e 20²...
Answer should be netween 200-400J A boy in a wheelchair (total mass 53.5 kg) has speed...
Answer should be netween 200-400J A boy in a wheelchair (total mass 53.5 kg) has speed 1.40 m/s at the crest of a slope 230 m high and 12.4 m long. At the bottom of the slope his speed is 7.00 m/s. Assume air resistance and rolling resistance can be modeled as a constant friction force of 41.0 N....
1. The melting points of most metals are higher than most plastics because: lonic bonds are...
1. The melting points of most metals are higher than most plastics because: lonic bonds are weaker than metallic bonds Van der Waals bonds are weaker than metallic bonds lonic and Van der Waals bonds are weaker than metallic bonds None of the above a. b. c. d. 2. A rubber band can stretch more than ...
An outdoor restaurant in a summer resort closes only on rainy days finite An outdoor restaurant...
an outdoor restaurant in a summer resort closes only on rainy days finite An outdoor restaurant in a summer resort closes only on rainy days. From past records, it is found that from May through September, when it rains one day, the probability of rain for the next day is 0.4 when it does not r...
Help? Need to know how to punch this in excel/financial calculator as well You work for...
Help? Need to know how to punch this in excel/financial calculator as well You work for a pharmaceutical company that has developed a new drug. The patent on the drug will last 17 years. You expect that the drug's profits will be \$2 million in its first year and that this amount will grow at a r...
You have graduated from the WCU and are now an administrator in a large orthopedic practice...
You have graduated from the WCU and are now an administrator in a large orthopedic practice for Mainline Health. There is strong demand for the orthopedic services and most of the patients that receive services are privately insured. You are aware that the senior physician’s wife is an excelle...
Fill in the blanks. a) The symbol and atomic number of the heaviest alkali metal are...
Fill in the blanks. a) The symbol and atomic number of the heaviest alkali metal are _____ and _____ ....
Assignment.docxOnline.docx df Ass 11 KB Myw㏄ My Backboard Content-Ba Return to Blackboard Dayis, Managerial Accounting, 3e...
Assignment.docxOnline.docx df Ass 11 KB Myw㏄ My Backboard Content-Ba Return to Blackboard Dayis, Managerial Accounting, 3e CALCULATOR PRINTER VERSİON ·BACK NEXT Exercise 13-12 The following items were gathered from Blossom Company's general ledger Purchase of marketable securi...
I need this in C programing And please give me complete code with screenshot of your...
I need this in C programing And please give me complete code with screenshot of your output. onded reverze. e le defnes α node stricture identical to the list nodes for the cycle detection probem in Lab4 3. Cycle le removal (20 points). Implemeat the function break.cycleO in The prototyp...
Consider the following hypotheses: H0: μ ≤ 270 HA: μ > 270 Find the p-value for this test based on the following samp...
Consider the following hypotheses: H0: μ ≤ 270 HA: μ > 270 Find the p-value for this test based on the following sample information. (You may find it useful to reference the appropriate table: z table or t table) a. x¯x¯ = 277; s = 23; n = 18 0.025   p-value < 0....
Makes 3 riboflavin, foli 200 acid) aLeavening (baking soda, sodium Yellow Corn Flour, Palm Oil, Complete...
makes 3 riboflavin, foli 200 acid) aLeavening (baking soda, sodium Yellow Corn Flour, Palm Oil, Complete rans Fat 0g CONTAINS WHEAT, SOY AND MILK Buttermilk Just Add Partally Produced with Genetic Sat Fat Less than Less than 2 400mg 2.40omgE Engineering NET WT 37 02 Food Label Calculation Assignment...
How do you solve  4x^2 - 5x + 1 = 0 ?
How do you solve  4x^2 - 5x + 1 = 0 ?...