Answer:
Explanation:
The following Java code creates the program which calls asks the user for an input and then passes that input into two methods toInches, and toGallons. Then the main method saves the returned values in variables and prints out a statement for each.
import java.util.Scanner;
class Brainly {
static Scanner in = new Scanner(System.in);
public static void main(String[] args) {
System.out.println("Enter a value: ");
int answer = in.nextInt();
double inches = toInches(answer);
double gallons = toGallons(answer);
System.out.println("There are " + inches + " inches in " + answer + " centimeters");
System.out.println("There are " + gallons + " gallons in " + answer + " liters");
}
public static double toInches(int centimeters) {
return (centimeters / 2.54);
}
public static double toGallons(int liters) {
return (liters / 3.7854);
}
}