desislava_topuzakova

04. Inches to Cm

Oct 17th, 2021
639
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class InchesToCm_04 {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         //1. прочитаме дробно число -> бр. инчовете
  8.         //2. преобразувам инчове в см -> см = инчове * 2.54
  9.         //3. печатаме см
  10.         double inches = Double.parseDouble(scanner.nextLine());
  11.         double cm = inches * 2.54;
  12.         System.out.println(cm);
  13.     }
  14. }
  15.  
RAW Paste Data