Kimes

Inches

Oct 22nd, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Scan {
  3.     public static void main (String[] args)
  4.     {
  5.         Scanner in = new Scanner(System.in);
  6.        
  7.         System.out.println("Podaj szerokość w calach");
  8.         Double paperWidth = in.nextDouble();
  9.        
  10.         System.out.println("Podaj wysokość w calach");
  11.         Double paperHeight = in.nextDouble();
  12.        
  13.        
  14.         final double CM_PER_INCH = 2.54;
  15.         double width = paperWidth * CM_PER_INCH;
  16.         double height = paperHeight * CM_PER_INCH;
  17.        
  18.         System.out.println("Rozmiar kartki wynosi "+width+"cm na "+height+"cm");
  19.     }  
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment