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
A helicopter blade does 3206 full turns in 7 minutes. Work out the number of full turns per minute? Then work out how many turns
ANEK [815]

Answer:

458 turns/min ----- 13740/30 min

Step-by-step explanation:

3206/7 (min) = 458

458 x 30 (min) = 13740

6 0
2 years ago
What is the value of x?
Reptile [31]

Answer:

....................

4 0
3 years ago
The volume of a sphere can be found using the formula V = πr . If the sphere has a diameter of 10x y z mm, what is the volume of
viva [34]

Answer:

<em>500πx³y³z³ </em>

Step-by-step explanation:

Volume of a sphere = 4πr³

r is the radius of the sphere

Given

Diameter of the sphere = 10xyz mm

Radius = diameter/2

Radius = 10xyz/2

Radius = 5xyz

Substitute the radius into the formula

Volume of the sphere = 4π(5xyz)³

Volume of the sphere = = 4π(125)x³y³z³

Volume of the sphere = 500πx³y³z³

<em>Hence the volume of the sphere is 500πx³y³z³ mm³</em>

8 0
2 years ago
Answer I will mark your brainlist
yan [13]

Answer:

Mark C.

Step-by-step explanation:

If there are 27 students in both classes, it's logicial to multiply both classes by two to get the total students.

Since the <em>S</em> stands for the students absent, that should come after the brackets.

3 0
2 years ago
Plz need help <br> It’s for geometry
Anestetic [448]

Answer:

Angle x = 48

Angle y = 42

Side w = 1.6cm

6 0
3 years ago
Other questions:
  • Find three solutions of the equation.
    9·1 answer
  • Write 2 1/4 as improper fraction
    8·2 answers
  • what is the simple formula corresponding to the explicit formula if the first term of the sequence is -10 and the difference bet
    6·1 answer
  • Which alternative will increase the probability of detecting a shift in the process average?
    6·1 answer
  • F (x) = 2x² + 3x + 4 g(x) = x + 5 What is (f (x)) . (g(x))?​
    13·1 answer
  • How do you simplify logarithms? Show example
    13·1 answer
  • 5 5/6 divided by 2 1/3
    15·2 answers
  • Use inequalities to describe yh3 shaded area​
    11·1 answer
  • How many solutions does the system have? 4x-2y=8 2x+y=2
    10·1 answer
  • What id the height of the triangle?​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!