Assignment #45

Code

///Name: Conner Wygaerts
///Period: 6
///Project Name: ChooseAdventure
///File Name: ChooseAdventure.java
///Date Finished: 10/22/15

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 Conner's tiny adventure!");
            System.out.println();
            System.out.println("You are in school and late to class! Would you like to go to \"class\" or to the \"library\"?");
            r1 = keyboard.next();
            
            System.out.println();
            
            if (r1.equals("class"))
            {
                System.out.println("You enter the classroom and the class stares at you. You may go to your \"seat\" or to a \"happy-place\".");
                r2 = keyboard.next();
                
                System.out.println();
                
                if (r2.equals("seat"))
                {
                    System.out.println("You sit down and the teacher resumes the lecture. Would you like to take notes? (\"yes\" or \"no\")");
                    r3 = keyboard.next();
                    
                    System.out.println();
                    
                    if (r3.equals("yes"))
                    {
                        System.out.println("You pass the class and become a good student. Thank you for playing!");
                    }
                    else if (r3.equals("no"))
                    {
                        System.out.println("You fail the class and become homeless. Thank you for playing!");
                    }
                }
                else if (r2.equals("happy-place"))
                {
                    System.out.println("You enter a dream. Is it a bad or good dream? (\"bad\" or \"good\")");
                    r4 = keyboard.next();
                    
                    System.out.println();
                    
                    if (r4.equals("bad"))
                    {
                        System.out.println("Im sorry about your problem but thanks for playing!");
                    }
                    else if (r4.equals("good"))
                    {
                        System.out.println("Congrats your now day dreaming and probably look pretty weird in front of your fellow class mates. than you for playing");
                    }
                }
            }
            else if (r1.equals("library"))
            {
                System.out.println("You enter the library. you want to go sit down do you sit with your crush and flirt or sit with friends? \"crush\" or \"friends\" confrontation.");
                r5 = keyboard.next();
                
                System.out.println();
                
                if (r5.equals("crush"))
                {
                    System.out.println("Your flirting attempts fail epically. Would you like to try again? (\"yes\" or \"no\")");
                    r6 = keyboard.next();
                    
                    System.out.println();
                    
                    if (r6.equals("yes"))
                    {
                        System.out.println("You are harshly rejected and your dreams are crushed. Thank you for playing!");
                    }
                    else if (r6.equals("no"))
                    {
                        System.out.println("You find a better girl and become happily married. Thank you for playing!");
                    }
                }
                else if (r5.equals("friends"))
                {
                    System.out.println("Do you like your friends? (\"yes\" or \"no\")");
                    r7 = keyboard.next();
                    
                    System.out.println();
                    
                    if (r7.equals("yes"))
                    {
                        System.out.println("Good them keep them. Thank you for playing!");
                    }
                    else if (r7.equals("no"))
                    {
                        System.out.println("Then find new friends. Thank you for playing!");
                    }
                }
            }
        }
    }

Picture of the output

YourInitials.html