1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
scoundrel [369]
3 years ago
5

// QuartsToGallons.java public class QuartsToGallons { public static final int QUARTS_IN_GALLON = 4; public static void main(Str

ing[] 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"); } }
Mathematics
1 answer:
sashaice [31]3 years ago
6 0

Program rearranged

// QuartsToGallons.java

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");

}

}

Answer:

The output of the program is

A job that needs 18 quarts requires 4 gallons plus 2 quarts

Step-by-step explanation:

From the rearranged program above

At line 3, a global variable named QUARTS_IN_GALLON is declared

The Variable is declared as an integer

And the Variable is initialised to 4

At line 5, a local Variable is declared

The Variable is declared as an integer

And the Variable is initialised to 18

At Line 7, some arithmetic operations are done and the result of the Calculation is printed alongside some strings

The first operation is quartsNeeded/QUARTS_IN_GALLON

This is an integer division and the result will be in integer.

So, 18/4 = 4

The second operation is quartsNeeded%QUARTS_IN_GALLON

This means the remainder of the integer division

So 18%4 = 2

Then, the final step is to execute the print operation which outputs the following

A job that needs 18 quarts requires 4 gallons plus 2 quarts

You might be interested in
Please answer as many as you can.
dimaraw [331]

Answer: okay so your problems are like 10000000k through  out resons of dum. so x=-1. is a little wrong becayse the x = into a 1 so  you make the 1 that factor. so thats why answer for 2.5

Step-by-step explanation:

6 0
2 years ago
How many days will it take for a culture of bacteria to increase from 200 to 50000 if the growth rate per day is 93.2%
densk [106]

Answer:

89 days

Step-by-step explanation:

5 0
2 years ago
Mrs. Carter has 4 boxes of colored chalk. There are 30 pieces of chalk in each box.
Tasya [4]

Answer:

120

Step-by-step explanation:

30 x 4 = 120

4 0
2 years ago
70.2 x 10<br> 6.702 x 10?<br> 7.02 x 100<br> 7.02 x 10?
Orlov [11]

Answer:

70.2 x 10=702.

6.702 x 10=67.02

7.02 x 100=70.2

7.02 x 10=70.2

Step-by-step explanation:

I hope this help! :)

3 0
3 years ago
Read 2 more answers
Does anyone know the answer ?
Ipatiy [6.2K]
Y = 3x - 8
Because y = mx + b, where m is the slope and b is the y-intercept, just substitute the two numbers.
6 0
2 years ago
Other questions:
  • Please explain how to do this
    10·2 answers
  • Approximately 68% of films are rated R. If 720 films were recently rated, how many were rated R?
    11·1 answer
  • In Death Valley, California, the highest ground temperature recorded was 94°C on July 15, 1972. In the formula C = 59(F −32), C
    14·1 answer
  • A football field is 300 ft x 160 ft . If A coach ask his players to run from one corner to the opposite corner diagonally, how f
    13·2 answers
  • Simply the fraction <br><br> 21wx<br> 49xy
    8·1 answer
  • Which is the best first step and explanation for solving this system of equations? 3x+4y=12 3x=2y-8​
    10·1 answer
  • Someone help fast please
    11·2 answers
  • Find the area of the circle.
    7·2 answers
  • Calculate the average rate of change of y=x2+3x−2 on the interval 1≤x≤2
    7·1 answer
  •  If you continue operating the tractor at its current level, how many acres can you expect to fertilize in the next hour?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!