Advertisement
kocev

Rakiya

Feb 19th, 2020
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Rakiya {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int day = 0;
  7.         double sugar = 100;
  8.         double alcohol = 0;
  9.         double alcWithoutVinegard = 0;
  10.         double temp2;
  11.         do {
  12.             alcohol = sugar / 10;
  13.             sugar = sugar - alcohol;
  14.             alcWithoutVinegard += alcohol - alcohol / 100;
  15.             day++;
  16.         }
  17.         while (alcWithoutVinegard <= sugar);
  18.         System.out.printf("The largest amount of alcohol will be harvested at %d day", day);
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement