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
15 divided by 3.15 what is the unit rate
stiv31 [10]

Answer: 4.8 i think

Step-by-step explanation: its just division

7 0
3 years ago
14. Twelve more than seven times a number equals the number less six
kotegsom [21]

Answer:

The number is -3.

Step-by-step explanation:

Set up an equation:

Variable n = number

12 + 7n = n - 6

Assuming the question is solve for n, isolate the variable:

Subtract n from both sides:

12 + 6n = -6

Subtract 12 from both sides:

6n = -18

Divide by 6 on both sides:

n = -3

Check your work:

12 + 7(-3) = -3 - 6

12 - 21 = -3 - 6

-9 = -9

Correct

3 0
3 years ago
Read 2 more answers
Suppose the function f(x) = 0.035x represents the number of U.S. dollars equivalent to x Russian rubles, and the function g(x) =
const2013 [10]

Answer:

g(f(x)) = 3.15x

Step-by-step explanation:

To find the number of Japanese yen equivalent to x russian rubles, we need to put one function into another.

If we take f(x) and put in into g(x), we will get Japanese yen in terms of rubles. Thus,

g(f(x)) = 90 (0.035x)

g(f(x)) = 3.15x

THis is the composite function which represents the number of Japanese yen equivalent to x Russian Rubles.

4 0
3 years ago
PLEASEE HELPP IM SO STUPID IDK HOW TO SOLVE THIS ILL GIVE U POINTD AND BRAINLIEST PLEASEEEEEE
scZoUnD [109]

Answer:

3 gallons I am in math club believe it or not

6 0
3 years ago
MATH HELP PLEASE DUE SOON!
julsineya [31]

Answer:

a

Step-by-step explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • Solve −27=19−2x for x . First, identify the best first step in solving this equation. What choice is correct?
    5·1 answer
  • Shawn earned $220 at his summer job. Shawn put 60% of his money in savings. How much money did Shawn put into savings?
    5·1 answer
  • Solve the system of equations given below.
    6·2 answers
  • Please help me quick ASAP!!!!<br> With all the questions
    12·2 answers
  • Figure LMNO maps to L’M’N’O’ by a 125° rotation about point T Which congruency statement is correct?
    6·2 answers
  • A silver bracelet has mass of 52.45g and volume of 5cm³ find density of silver braclet​
    11·1 answer
  • The sides of a triangle have lengths s, s+4, and 3s. write an expression in simplest form that represents the perimeter of the t
    12·1 answer
  • My question is to answer
    7·1 answer
  • ©
    15·1 answer
  • Graph the line that passes through the points (-3, -5) and (−3,−3) and determine the equation of the line.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!