Assignment #45

Code

///Name: Mahima Choudhary
///Period: 6
///Project Name: ChooseAdventure
///File Name: ChooseAdventure.java
///Date Finished: 11/12/15


import java.util.Scanner;

public class ChooseYourOwnAdventure {
    
    public static void main( String[] args ) {
        
        Scanner keyboard = new Scanner(System.in);
        
        String a1, a2, b1, b2, c1, c2, d1;
        
        System.out.println( "WELCOME TO MAHIMA's tiny adventure!" );
        System.out.println();
        
        System.out.println( "You are in a hospital and have a broken leg! ");
        System.out.println( "Do you \"a\" go to the emergency or \"b\" to the orthpedics?");
        a1 = keyboard.next();
        System.out.println();
        
        if ( a1.equals("a") ) {
            System.out.println( "You enter the emergency and the someone is having a heart attack in front of you." );
            System.out.println( "Do you \"a\" try helping or \"b\" go to a seat?" );
            a2 = keyboard.next();
            System.out.println();
            
            if ( a2.equals("a") ) {
                System.out.println( "You try helping, and save their life. It ends up being Donald Tryump, and he offers you 4 million dollars for saving his life." );
                System.out.println("Do you accept the money? \"a\" yes or \"b\"no" );
                b2 = keyboard.next();
                System.out.println();
                
                if ( b2.equals("a") ) {
                    System.out.println( "You donate 90 percent of it to charity and use the other 10 percent to travel the world. Thank you for playing!" );
                }
                
                else if ( b2.equals("b") ) {
                    System.out.println( "You are stupid and continue living an average life. Thank you for playing!" );
                }
                else {
                	System.out.println("Better luck next time.");
                }
            }
                
            else if ( a2.equals("b") ) {
                System.out.println( "You become unconscious from the pain in your leg and you are hallucinating that aliens are inviting you to Mars." );
                System.out.println( "Do you \"a\" accept the invatation or \"b\" decline?" );
                c1 = keyboard.next();
                System.out.println();
                
                if ( c1.equals("a") ) {
                    System.out.println( "It was a trap, they are evil Aliens and kill you the moment you enter their spaceship, but thanks for playing!" );
                
                }
                
                else if ( c1.equals("b") ) {
                    System.out.println( " You are lucky, they take your little brother instead and tickle him to death, thank you for playing." );
                }
                    else {
                    	System.out.println("Better luck next time.");
                }
                
            }
        }
        
        else if ( a1.equals("b") ) {
            System.out.println( "You enter the orthopedics and they think you will feel better temporily if they break your other leg to level out the pain. ?" );
            System.out.println( "Do you let them break the other leg \"a\" yes or \"b\" no?" );
            b1 = keyboard.next();
            System.out.println();
            
            if ( b1.equals("a") ) {
                System.out.println( " It suprisingly doesnt work and you are kinda screwed." );           
                System.out.println( "Do you want to sue? \"a\" yes \"b\" no " );
                c2 = keyboard.next();
                System.out.println();
                
                if ( c2.equals("a") ) {
                    System.out.println( " Ah you sue and get 10,000 dollars. However, the hospital is soaked with money and is not affected by you. Thank you for playing!" );
                }
                
                else if ( c2.equals("b") ) {
                    System.out.println( "They are thankful that you didnt sue and in return fix your broken legs.. Thank you for playing!" );
                }
                else {
                	System.out.println("Better luck next time.");
                }
            }
            
            else if ( b1.equals("b") ) {
                System.out.println( "They recommend breaking the other leg, but your are adament against it, so instead they think its best to give you a full body cast to make sure you dont break anything else." );
                System.out.println( "Do you accept the full body cast \"a\" accept or \"b\" decline?" );
                d1 = keyboard.next();
                System.out.println();
                
                if ( d1.equals("a") ) {
                    System.out.println( "You look really dumb and no one wants to be freinds with you any more and give you the nickname Mummy." );
                    System.out.println( "Ha time for you to go to your tomb, thanks for playing!" );
                }
                
                else if ( d1.equals("b") ) {
                    System.out.println( "They get fustrated and feel like you do not want to get better and refuse to help with your broken leg." );
                    System.out.println( "Great, your rude attitude causes for your entire bone structure to awkwardly grow back and you look like Frankenstien and no one wants to be friends with you." );
                }
                
                else {
                    System.out.println( "Better luck next time." );
                }
            }
            
            else {
                System.out.println( "Better luck next time." );
            }
        }
        
        else {
                System.out.println( "Better luck next time." );
        }
    }
}

Picture of the output

YourInitials.html