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
8×10^7×1.5×3^-1×10^-9​
quester [9]

Answer:

0.04

Step-by-step explanation:

3 0
3 years ago
See picture^<br><br> i will give brainliest to the first person who answers
Masja [62]

Answer:

The two 50ml bottles

Step-by-step explanation:

(I will be using the $ but just change the sign to the euros)

$55/80ml= .68 per ml

45+22.5= $67.5

67.5/100 is about $.67

Therefor the two 50ml bottles is cheaper per ML and you get more product

8 0
3 years ago
Read 2 more answers
A survey indicates that there are approximately 120 dairy farms in a given area. If there are exactly 400 farms, and exactly 20%
inna [77]

Answer:

120 out of 400 does not equal 20%

it equals 30%

Step-by-step explanation:

5 0
3 years ago
Read 2 more answers
Trish takes out a furniture loan of $5500 and a simple interest rate of 6% per year which of the following is closest to the amo
Step2247 [10]

Answer:

F

Step-by-step explanation:

First, converting R percent to r a decimal

r = R/100 = 6%/100 = 0.06 per year,

then, solving our equation

I = 5500 × 0.06 × 2.5 = 825

I = $ 825.00

The simple interest accumulated

on a principal of $ 5,500.00

at a rate of 6% per year

for 2.5 years is $ 825.00.

3 0
3 years ago
A fruit stand has to decide what to charge for their produce. They need $10 for 44 apples and 44 oranges. They also need $15 for
Bess [88]

Step-by-step explanation:

Let x be the price of an apple and y be the price of an orange.

We have been given that a fruit stand need $10 for 4 apples and 4 oranges. We can represent this information as:

4x+4y=10...(1)

We are also told that they need $15 for 6 apples and 6 oranges. We can represent this information as:

6x+6y=15...(2)

Therefore, our desired system of equations will be:

4x+4y=10...(1)

6x+6y=15...(2)


4 0
4 years ago
Other questions:
  • Which function is equivalent to y= -cot(x)?
    11·2 answers
  • Help, please! And also attempt to show work, thank you!
    13·1 answer
  • If a door is 36 inches in width opens to an angle of 140 degrees,how large an arc is created?
    8·1 answer
  • Why won't a tripod tip over
    15·2 answers
  • PLEASE HELP!!!
    15·2 answers
  • Y''+y'/x-y/x^2=0 y(1)=1, y(R)=n
    10·1 answer
  • Which results from a cross section made perpendicular to be base of a square pyramid
    9·1 answer
  • What are the ordered pairs of the solution?<br>2y+6&lt;8x<br>​
    8·1 answer
  • Determine whether the fractions are equivalent 27/48 and 18/28
    12·2 answers
  • Use the graph below to graph the system of inequalities. Be sure to include your shading.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!