Skip to content

Instantly share code, notes, and snippets.

@jonathan-irvin
Last active August 29, 2015 14:19
Show Gist options
  • Save jonathan-irvin/a7edff4c77c5e74bc599 to your computer and use it in GitHub Desktop.
Save jonathan-irvin/a7edff4c77c5e74bc599 to your computer and use it in GitHub Desktop.
Convert feet to meters
import java.util.Scanner;
public class Feet2Meters {
public static void main(String[] args) {
System.out.print("Enter distance in feet (ft): ");
Scanner input = new Scanner(System.in);
double feet;
feet = input.nextDouble();
double meters = feet * 0.305;
System.out.println(feet + "ft is equal to " + meters + "m");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment