SHARE
TWEET

Untitled

a guest Feb 18th, 2020 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class pro {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int kvmLoze = Integer.parseInt(scanner.nextLine());
  7.         double grozdekvm =Double.parseDouble(scanner.nextLine());
  8.         int nujniLitri = Integer.parseInt(scanner.nextLine());
  9.         int broiRabotnici = Integer.parseInt(scanner.nextLine());
  10.  
  11.         double totalGrozde = kvmLoze * grozdekvm;
  12.         double vino = Math.abs(0.4 * totalGrozde / 2.5) ;
  13.         if(vino > nujniLitri){
  14.             double ostavashtovino = vino -nujniLitri;
  15.             double vinoNaChovek = ostavashtovino / 3;
  16.             System.out.printf("Good harvest this year! Total wine: %.0f liters.%n %.0f liters left -> %.0f liters per person.", vino , ostavashtovino, vinoNaChovek);
  17.  
  18.         }else{
  19.             double nedostiga =(nujniLitri - vino);
  20.             double nedostigatochno = Math.abs(nedostiga);
  21.             System.out.printf("It will be a tough winter! More %.0f liters wine needed.", nedostigatochno);
  22.         }
  23.  
  24.  
  25.     }
  26. }
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