SHARE
TWEET

Untitled

a guest Oct 21st, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Úloha 21
  2. public static void main(String[] args) {
  3.  
  4.         System.out.println("Program, ktorý vypočíta koľko jahôd máš kúpiť " +
  5.                 "ak zadáš dĺžku fólie " + "a medzeri medzi jahodami");
  6.  
  7.         System.out.println();
  8.  
  9.         Scanner sc = new Scanner(System.in);
  10.         System.out.println("Zadaj dĺžku fólie(m)");
  11.         double a = sc.nextDouble();
  12.         System.out.println("Zadaj medzeru medzi jahodami(cm)");
  13.         double b = sc.nextDouble();
  14.         sc.close();
  15.  
  16.         double x1 = ( (a * 100) - 60) / b+1;
  17.         double x = Math.floor(x1);
  18.         System.out.println("Aby si využil fóliu ma by si kúpiť " + x + " jahôd");
  19.  
  20.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top