Question: Convert the QuartsToGallons program to an interactive application. Instead of assigning a value to the number of quarts, accept the value from the user as
Convert the QuartsToGallons program to an interactive application. Instead of assigning a value to the number of quarts, accept the value from the user as input.
This is what was given:
class QuartsToGallonsInteractive { public static void main(String[] args) { // Modify the code below int QUARTS_IN_GALLON = 4; int quartsNeeded = 18; int gallonsNeeded = int extraQuartsNeeded =
gallonsNeeded = quartsNeeded / QUARTS_IN_GALLON; extraQuartsNeeded = quartsNeeded % QUARTS_IN_GALLON;
System.out.println( );
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
