Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- //1 Foot (ft) is equal to 0.3048 meter (m). To convert feet to meters, multiply
- //the foot value by 0.3048 or divide by 3.280839895.
- public class ConvertFootMeters {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- //USER INPUT
- System.out.println("How many foot do you need to convert to meters?");
- System.out.println("Type in foot in number and press enter: ");
- Double foot = input.nextDouble();
- Double meters = foot * 0.3048;//The calculation
- //OUTPUT IN YOURE CONSOLE
- System.out.println(String.valueOf(foot) + "foot = " + meters + " meters.");
- }
- }
RAW Paste Data