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
SHOW YOUR WORK and ill give brainlest :)
Rashid [163]

The price of the Xbox One after tax is $265

<h3><u>Solution:</u></h3>

The price of a Xbox one is $250

The tax on Xbox one is 6%  

Now, the tax of 6% on 250 is calculated as follows:-

=\frac{6}{100} \times 250\\\\=\frac{250 \times 6}{100}=\frac{1500}{100}=15

So, the tax on Xbox one is $15

The total price of box including tax can be calculated by adding price of box and tax on box

<em>Total price of Xbox after tax = actual price of the Xbox One  + Tax on the Xbox One </em>

= $250 + $15

= $265

Hence, the price of the Xbox One after tax is $265

3 0
3 years ago
3x+y=115x-y=21 Directions: Solve each system of equations by elimination. Clearly identify your solution.
olchik [2.2K]

To solve, we will follow the steps below:

3x+y=11 --------------------------(1)



5x-y=21 ------------------------------(2)

since y have the same coefficient, we can eliminate it directly by adding equation (1) and (2)

adding equation (1) and (2) will result;

8x =32

divide both-side of the equation by 8

x = 4

We move on to eliminate x and then solve for y

To eliminate x, we have to make sure the coefficient of the two equations are the same.

We can achieve this by multiplying through equation (1) by 5 and equation (2) by 3

The result will be;

15x + 5y = 55 ----------------------------(3)

15x - 3y =63 --------------------------------(4)

subtract equation (4) from equation(3)

8y = -8

divide both-side of the equation by 8

y = -1

8 0
1 year ago
Dividing a whole number by a unit fraction results in a:
Alex Ar [27]

Answer:

each unit being divided into smaller parts

Step-by-step explanation:

7 0
2 years ago
Help! can someone help me out on this?
Fynjy0 [20]

Answer:

solve by substitution method

6 0
3 years ago
Find the tangent of ∠I.
Nady [450]

Answer:

tanI = \frac{\sqrt{70} }{5}

Step-by-step explanation:

We require to calculate GH using Pythagoras' identity in the right triangle.

GH² + GI² = HI²

GH² + 5² = (\sqrt{95} )²

GH² + 25 = 95 ( subtract 25 from both sides )

GH² = 70 ( take square root of both sides )

GH = \sqrt{70}

Then

tanI = \frac{opposite}{adjacent} = \frac{GH}{GI} = \frac{\sqrt{70} }{5}

4 0
2 years ago
Other questions:
  • How would i solve
    13·1 answer
  • Plzzzzzzzzzzzzzzzz asap help
    11·1 answer
  • I need help on this questionnn
    9·2 answers
  • PLEASE HELP ME WITH THIS
    6·2 answers
  • What is the formula for 3cm, 5cm, and 4cm (3cm being the height and the 4 the base) and its a right triangle
    13·1 answer
  • No links plz real answers
    5·1 answer
  • <img src="https://tex.z-dn.net/?f=%20%5Cfrac%7B2%7D%7B3%7D%20%20%5Ctimes%205%5Cfrac%7B2%7D%7B4%7D%20" id="TexFormula1" title=" \
    10·1 answer
  • Help me with this scorpy TY SO MUCH &lt;333
    11·1 answer
  • Dr. King was born in Atlanta, Georgia. What is the distance in miles from Washington, DCto Atlanta, Georgia?
    6·1 answer
  • Write an equation of the line passing through point p that is parallel to the given line.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!