Assignment #45

Code

    /// Gian Adoremos
    /// Period: 7
    /// Program Name: FortyFifth Program
    /// File Name: ChooseAdventure.java
    /// Date Finished: 11/19/2015

    
    import java.util.Scanner;

    public class ChooseAdventure
    {
        public static void main(String[] args)
        {
            Scanner keyboard = new Scanner(System.in);
            
            String r1, r2, r3, r4, r5, r6, r7;
            
            System.out.println("WELCOME TO THE GREATEST ADVENTURE OF ALL TIME!!");
            System.out.println();
            System.out.println("You are in a hospital. Would you like to go to the \"front desk\" or to the \"bathroom\"?");
            r1 = keyboard.next();
            
            System.out.println();
            
            if (r1.equals("front desk"))
            {
                System.out.println("You enter the front desk and see your mother. You decide to go \"upstairs\" or to the  \"waiting\" room.");
                r2 = keyboard.next();
                
                System.out.println();
                
                if (r2.equals("upstairs"))
                {
                    System.out.println("You go back upstairs. Would you like to leave or stay? (\"leave\" or \"stay\")");
                    r3 = keyboard.next();
                    
                    System.out.println();
                    
                    if (r3.equals("leave"))
                    {
                        System.out.println("You leave the house and stay alive. Thank you for playing!");
                    }
                    else if (r3.equals("stay"))
                    {
                        System.out.println("You get eaten alive. Thank you for playing!");
                    }
                }
                else if (r2.equals("waiting"))
                {
                    System.out.println("You suddenly drop to the floor in pain. Do you ask for (\"help\" or \"do nothing\")");
                    r4 = keyboard.next();
                    
                    System.out.println();
                    
                    if (r4.equals("help"))
                    {
                        System.out.println("You are saved!");
                    }
                    else if (r4.equals("do nothing"))
                    {
                        System.out.println("You are saved because luckily you were in the hospital");
                    }
                }
            }
            else if (r1.equals("bathroom"))
            {
                System.out.println("You sit down on the toilet. You hear footsteps but you really need to let out a fart. Do you let it \"rip\" or \"hold\" it in.");
                r5 = keyboard.next();
                
                System.out.println();
                
                if (r5.equals("rip"))
                {
                    System.out.println("You hear a woman scream and you realize you are in the wrong restroom. Do you run out? (\"yes\" or \"no\")");
                    r6 = keyboard.next();
                    
                    System.out.println();
                    
                    if (r6.equals("yes"))
                    {
                        System.out.println("Without thinking you run out without pulling up your pants. As you run out you see that there was a line into the restroom you were in. You are exposed and you faint on the spot with your pants down.");
                    }
                    else if (r6.equals("no"))
                    {
                        System.out.println("You wait til you hear the person leave and make your way out.");
                    }
                }
                else if (r5.equals("leave"))
                {
                    System.out.println("You get to the fridge. Would you like to open the fridge? (\"yes\" or \"no\")");
                    r7 = keyboard.next();
                    
                    System.out.println();
                    
                    if (r7.equals("yes"))
                    {
                        System.out.println("You find a giant stuffed chicken and devour it. Thank you for playing!");
                    }
                    else if (r7.equals("no"))
                    {
                        System.out.println("You starve to death. Thank you for playing!");
                    }
                }
            }
        }
    }
 

Picture of the output

Assignment 45