Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- import java.util.Random;
- public class juice {
- public static void main(String args[]){
- Scanner scan = new Scanner(System.in);
- Random rand = new Random();
- int juice = 99, weight, limit = 0;
- System.out.println("There are 99 bottles of apple juice on the wall ");
- System.out.println("Please enter your weight to begin the party: ");
- weight = scan.nextInt();
- if (weight <= 150){
- limit = rand.nextInt(99)+70;
- }
- if (weight > 150 && weight <= 200){
- limit = rand.nextInt(99)+50;
- }
- if (weight > 200){
- limit = rand.nextInt(99)+1;
- }
- while (juice > 2){
- System.out.print(juice + " bottles of juice on the wall! ");
- System.out.println(juice + " bottles of juice! \n You take one down - pass it around...");
- juice -= 1;
- System.out.println(juice + " bottles of juice on the wall!");
- if (juice == limit){
- System.out.println("You've reached your limit and passed out");
- System.out.println("While passed out, a mugger stole your wallet");
- System.out.println("You should rethink your drinking habbits");
- }
- }
- if (juice == 2){
- System.out.println("Only 1 bottle of juice left on the wall!");
- System.out.println("You take it down...pass it around \nNo more bottles of juice on the wall!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement