Advertisement
Kimes

Untitled

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