Question: in java Modify as specified GalToLiters.java below class GalToLiters { public static void main ( String args [ ] ) { double gallons, liters; gallons

in java Modify as specified GalToLiters.java below
class GalToLiters
{ public static void main(String args[])
{ double gallons, liters;
gallons =10;
liters = gallons *3.7854;
System.out.println(gallons+" gallons is "+ liters + "liters.");
}
}
Modify it to have an additional variable Qrts
Calculate the number of quarts (there are 4 per gallon)
In addition output the relationship of Quarts to Gallons
Also output the relationship of Quarts to Liters

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 Programming Questions!