Advertisement
galinyotsev123

ProgBasicsJavaBook2.1SimpleCalculations02InchesToCm

Jan 25th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. System.out.print("Inches = ");
  8. Double inches = scanner.nextDouble();
  9. Double centimeters = inches * 2.54;
  10.  
  11. System.out.print("Centimeters = ");
  12. System.out.println(centimeters);
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement