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
If I Uninstall Nba 2k 19 from my ps4 will my career be gone forever?​
Rudik [331]

Answer:

Not unless you have a ps plus membership

Explanation:

Ps plus have cloud storage so if you have ps plus membership,even if you delete 2k19 your data will be saved in the cloud storage therefore your my carrer will not be gone forever!

7 0
3 years ago
Read 2 more answers
Ten(10) examples of wearables or wearable technologies?​
Semmy [17]

Answer:read

Explanation:

airpods

headphones

earbuds

AirPods  pro

watch

fitbit (type of watch that counts your miles) &you can say workout watch&

VR set

technology bracelet

smart glasses

Smart ring

7 0
3 years ago
You want to decide whether you should drive your car to work or take the train. You know the one-way distance from your home to
tester [92]

<u>Explanation:</u>

Remember, an algorithm in simple words means a set of instructions or steps to be followed in other to solve a problem.

Note, to decide which commute is cheaper, it means the output of the algorithm should be the cheaper way to commute.

Using pseudocode do the following;

  • determine the inputs and outputs of the problem
  • arrange the identified problem into micro-tasks
  • describe each micro-tasks in the pseudocode
  • Test the pseudocode by solving the problem.

                       

3 0
3 years ago
Which type of document would be best created in Word? HELLP!!!!
bekas [8.4K]
I think it’s presentation.
Like if I am right.
8 0
3 years ago
Read 2 more answers
Write a program that prompts the user for input and allows all of these member data values to be specified. The program should c
erma4kov [3.2K]

Answer:

The program to this question can be defined as follows:

Program:

#include <iostream> //defining header file

using namespace std;

struct MovieData  //defining structure MovieData

{

//defining structure variables

string Title; //defining string variable

int Year; //defining integer variable

string Timing; //defining string variable

};

void displayMovie(MovieData M_data) //defining method displayMovie

{

//print values

cout << "Title: "<<M_data.Title<<endl;

cout << "year: "<<M_data.year<<endl;

cout << "Timing: "<<M_data.Timing<<endl;

}

int main () //defining main method

{

MovieData z1,z2; //creating structure variables

cout<<"\t \t Enter First Movie Details:"<<endl; //message

cout << "Enter Title: ";//message

cin>>z1.Title; //input value

cout << "Enter Year: "; //message

cin>>z1.Year; //input value

cout << "Enter Timing: "; //message

cin>>z1.Timing;//input value

cout<<"\t \t Enter Second Movie Details: "<<endl;

cout << "Enter Title: "; //message

cin>>z2.Title;//input value

cout << "Enter Year: "; //message

cin>>z2.Year;//input value

cout << "Enter Timing: "; //message

cin>>z2.Timing;//input value

cout<<"\t\t Movies Detail:"<<endl; //message

displayMovie(z1); //calling a method

displayMovie(z2); //calling a method

return 0;

}

Output:

   Enter First Movie Details:

Enter Title: DDLJ

Enter Year: 2004

Enter Timing: 9to12am

   Enter Second Movie Details:  

Enter Title: RRR

Enter Year: 2010

Enter Timing: 12to3am

  Movies Detail:

Title: DDLJ

Year: 2004

Timing: 9to12am

Title: RRR

Year: 2010

Timing: 12to3am

Explanation:

In the above program a structure "MovieData" is defined, which is used to collect different type of values, inside the structure three variable "Title, Year, and Timing" is declared, in which "Title and Timing" is a string variable and Year is an integer variable.

  • In the next step, a method "displayMovie" is defined, in which we pass a structure object, which is "M_data", that prints the structure details.
  • In the main method two structure variable "z1, and z2" is declared, which take input in the structure variable and call the displayMovie method.
3 0
3 years ago
Other questions:
  • What company handles security for a lot of the e-commerce on the internet and also maintains two root name server clusters?
    8·1 answer
  • Study the sentence below. Highlighting a word, phrase, or a sentence is used to emphasize or CALL ATTENTION to the text Which wo
    10·1 answer
  • Gabriel needs to create a formula that does not change when it is copied to cell b2. which formula should he create?
    14·1 answer
  • Why are user application configuration files saved in the user’s home directory and not under /etc with all the other system-wid
    6·1 answer
  • Define the missing method. licenseNum is created as: (100000 * customID) licenseYear, where customID is a method parameter. Samp
    14·2 answers
  • A corporation needs an operating system that allows the various teams in its office to network and collaborate on projects. Whic
    15·2 answers
  • which of the following is not an e-reader you would use as a alternative to carrying around a set of textbooks?
    8·1 answer
  • how risk can impact each of the seven domains of a typical IT infrastructure: User, Workstation, Local Area Network (LAN), Local
    7·1 answer
  • Lab: even/odd values in an array
    5·1 answer
  • What are the uses of navigation keys​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!