Kevin321888999

Unit Conversions

Jul 18th, 2022
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.96 KB | None | 0 0
  1.  
  2. import java.io.*;//Java standard input/output library. The *allows full access to everything within the library.
  3. import java.util.*;
  4.  
  5. public class Main {
  6.     public static void main(String[] args) throws IOException {
  7.         double inches;//Declaration of inches and feet.
  8.         double feet;
  9.       BufferedReader BR= new BufferedReader(new InputStreamReader (System.in));//This allows for the system to read separate individual user inputted objects. Such as numbers.
  10.  
  11.       Scanner scanner= new Scanner(System.in);//This allows for the input of full length messages to be inputted from the user.
  12.       System.out.println("Convert from inches to feet: ");
  13.       System.out.println("Inches: ");
  14.  
  15.       inches=Double.parseDouble(BR.readLine());//Reads the individual number inputted by the user.
  16.       feet= inches/12;//conversion rate from inches to feet is to divide by 12.
  17.       System.out.println("Conversion from inches to feet: "+feet);
  18.      
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment