@UmerkkkKhan/

JealousCaringCommercialsoftware

Java

No description

fork
loading
Files
  • Main.java
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import java.util.Scanner;
public class GreenBottles{

    public static void main(String[] args){
        
        Scanner input = new Scanner(System.in);
        
        System.out.println("Please Total Bottles :");
        int totalBottles = input.nextInt();
        System.out.println("How Many You Want To Drop? :");
        int fell = input.nextInt();
        
        while(totalBottles >= 1){

          System.out.println(totalBottles+" green bottles standing on the wall");
          System.out.println(totalBottles+" green bottles standing on the wall");
          System.out.println("And if "+fell+" green bottle should accidently fall");
          int left = totalBottles - fell;
          if (left <= 0){
            System.out.println("There’ll be No green bottles standing on the wall.");
            System.out.println("");
          }
          else {
            System.out.println("There’ll be "+left+" green bottles standing on the wall.");
            System.out.println("");
          }
          
          totalBottles = totalBottles - fell;
        }

    


        
        
        
        
        
        
            
        }
    
    }