Advertisement
veronikaaa86

InchesToCentimeters

Jun 5th, 2021
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class InchesToCentimeters {
  4. public static void main(String[] args) {
  5. //1. инчове (реално число) -> конзолата
  6. //2. преобразувам инчове в см -> см = инчове * 2.54
  7. //3. печатаме см
  8. Scanner scan = new Scanner(System.in);
  9. double inches = Double.parseDouble(scan.nextLine());
  10. double cm = inches * 2.54;
  11. System.out.println(cm);
  12.  
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement