Question: public class QuartsToGallons { public static void main ( String [ ] args ) { / / aaaaaaaaaaaaaaaa final int QUARTS _ IN _ GALLONS

public class QuartsToGallons {
public static void main(String[] args){
//aaaaaaaaaaaaaaaa
final int QUARTS_IN_GALLONS =4;
int quartsNeeded =18;
int gallons = quartsNeeded / QUARTS_IN_GALLONS;
int quartsLeftOver = quartsNeeded % QUARTS_IN_GALLONS;
System.out.println("A job that needs "+ quartsNeeded +" quarts requires "+ gallons +" gallons plus "+ quartsLeftOver +" quarts.");
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!