Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4. public static void main(String[] args) {
  5. Scanner sc=new Scanner(System.in);
  6.  
  7. int x= Integer.parseInt(sc.nextLine());
  8. double y= Double.parseDouble(sc.nextLine());
  9. int z= Integer.parseInt(sc.nextLine());
  10.  
  11. double grape= x*y;
  12. double grapeForWine= (grape/2.5) * 0.4;
  13. if (grapeForWine >=z){
  14. System.out.printf("Good harvest this year! Total wine:%.0f liters.%n", Math.floor(grapeForWine));
  15. double left= grapeForWine- z;
  16. double winePerWorker= left/workers;
  17. System.out.printf("%.0f liters left-> %.0f liters per person." Math.ceil (left), Math.ceil (WinePerWorker));
  18. }else{
  19. double neededWine=z-grapeforWine;
  20. System.out.printf("It will be a tough winter! More %.0f liters wine needed.", Math.floor(neededWine));
  21. }
  22.  
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement