Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class SquareIt
- {
- public static void main(String[] args)
- {
- // variable declaration section
- Scanner in = new Scanner (System.in);
- double Liters = 0;
- int LiterToGallon = 0;
- // code execution section
- System.out.println("Enter the Liters that you need to be converted to gallons");
- Liters = in.nextInt();
- System.out.println(Liters + " Liters in gallons would be " + LiterToGallon(Liters) + " Gallons ");
- }
- public static double LiterToGallon(double number)
- {
- return(number / 3.785);
- }
- }
- // class method declaration section
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement