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
Tcecarenko [31]
3 years ago
11

Part A: Write the QuartsToGallons Java class that declares a named constant to hold the number of quarts in a gallon (4). Also d

eclare a variable to represent the number of quarts needed for a painting job, and assign an appropriate value—for example, 18. Compute and display the number of gallons and quarts needed for the job. Display explanatory text with the values, for example:
Computers and Technology
1 answer:
Sloan [31]3 years ago
4 0

Complete Question:

Part A: Write the QuartsToGallons Java class that declares a named constant to hold the number of quarts in a gallon (4). Also declare a variable to represent the number of quarts needed for a painting job, and assign an appropriate value—for example, 18. Compute and display the number of gallons and quarts needed for the job. Display explanatory text with the values, for example:

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

Answer:

The complete code is given in the explanation section

Explanation:

import java.util.Scanner;

public class QuartsToGallons {

   public static void main(String[] args) {

       final int NUMBER_OF_QUARTS = 4;

       int numJobs;

        Scanner in = new Scanner(System.in);

       System.out.println("Enter number of paint in quarts for the painting job?");

       numJobs = in.nextInt();

       int numGallons = numJobs / NUMBER_OF_QUARTS;

       int numQuarts = numJobs % NUMBER_OF_QUARTS;

       System.out.println("The painting Job of " + numJobs + " quarts requires "

               + numGallons + " gallons and " + numQuarts + " quarts of paint.");

   }

}

You might be interested in
What are 3 websites that talk about density of different gases, density in air, behavior of different gases of earth, convection
Tanzania [10]
I don’t know if this supports all, but try lenntech, duckters, and I will add on later
6 0
3 years ago
What kind of waste does a computer generate?<br><br> Will give brainly :3
Lena [83]

Answer:

waste???? a computer??

7 0
3 years ago
The atmosphere can produce the same effects as a
IceJOKER [234]
The answer is prism, The atmosphere can produce the same effects<span> as a </span>prism<span> when the </span>Sun is low in the sky<span>.  </span>
3 0
4 years ago
A machine’s ability to mimic human thinking to behave in a way that appears to be learning and solving problems is known as:
kkurt [141]

D. game mechanics D. game mechanics

7 0
3 years ago
Which of the following processes is not part of the rock cycle?
Leviafan [203]
Igneous rock forced below the Earth's surface where it is turned into sedimentary rock through intense heat and pressure.

This process creates metamorphic rocks, not sedimentary.
3 0
4 years ago
Other questions:
  • The following function open_file() opens a file called 'example.txt' and returns the file pointer. This function is called withi
    12·1 answer
  • Which one of the following types of statements is an instruction to replace the existing value of a variable with another value?
    13·1 answer
  • We use them every day, but what is the overall purpose of a search engine?​
    10·2 answers
  • ______ is the primary and dominant cryptographic authentication and encryption framework for security development within the TCP
    12·2 answers
  • Why did Herman Hollerith invent the Tabulating Machine?
    10·1 answer
  • Write a program that will add up the series of numbers: 99, 98, 97… 3, 2, 1. The program should print the running total as well
    13·1 answer
  • The way that a writer displays their personality and imagination on the page is called:
    13·1 answer
  • Choose the term that completes the sentence.
    14·2 answers
  • What is responsible for what you see on the monitor?
    13·1 answer
  • ___________ is some danger that can exploit a vulnerability.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!