Assignemnt #45

Code


 /// Name: Daniel Nguyen
 /// Period: 6
 /// Program Name: size Program
 /// File Name: adventure.java
 /// Date Finished: 9/9/2015

import java.util.Scanner ;
public class adventure
{
	public static void main( String[] args )
	{
        Scanner keyboard = new Scanner(System.in);
        
        String r1, r2, r3;
        r3 = "";
        r2 = "";
         System.out.println( "You are being held in a chair with a bag over your head and there are people questioning you." );
         System.out.println( "They ask if you know where the diamonds are. Answer 'yes' or 'no'" );
        System.out.println( "" );
            r1 = keyboard.next();
        
        if ( r1.equals("yes") ) {
        System.out.println( "They tell you if you don't tell them where they are they will put you in the oven." );
            System.out.println( "You answer 'yes' I will show you guys where they are, or 'no' I will never tell you." );
             r2 = keyboard.next();
        }
        else if ( r1.equals("no") ) {
        System.out.println( "They point a gun to your head and offer you one last chance to show them where the diamonds are" );
            System.out.println( "You fake them out and pretend you know where the diamonds are." );
            System.out.println( "You notice your hands are not tied and either find the gun in your pocket and 'shoot' everyone or 'wait' until the right moment presents itself." );
             r2 = keyboard.next();
        }
        if (r2.equals("yes")) {
            System.out.println( "They take the bag off of your head and shove you to show them where the diamonds are" );
            System.out.println( "In response you start to lead them to a random place because you don't actually know" );
            System.out.println( "where the diamonds are, so you either make a 'run' for it or you 'wait." );
            r3 = keyboard.next();
        }
       else if (r2.equals("no")) {
            System.out.println( "They put you in a room that seems felt like metal and was a little cold." );
            System.out.println( "You start to feel some heat." );
            System.out.println( "You notice you are burning and 'scream' I HAVE THE DIAMONDS or accept your fate and 'burn' to death." );
            r3 = keyboard.next();
        }
        else if (r2.equals("shoot")) {
            System.out.println( "You shoot randomly and hear people fall to the ground." );
            System.out.println( "Somehow you kill them all and remove the bag on your head." );
            System.out.println( "You find the closest 'door' and walk through it or you escape through the 'window'." );
             r3 = keyboard.next();
        }
       else if (r2.equals("wait")) {
            System.out.println( "You hear someone say help me carry this" );
            System.out.println( "You notice everyone has left to help carry something" );
            System.out.println( "After everyone leaves to help carry something you pull the bag off of your head and 'shoot' all the people or you 'run' for your life." );
            r3 = keyboard.next();
        }
         if (r3.equals("run")) {
            System.out.println( "You are running to the door and someone notices you." );
            System.out.println( "You feel a sharp pain in your right calf." );
            System.out.println( "Someone walks up to you and shoots you." );
         }
        if (r3.equals("wait")) {
            System.out.println( "Guess what? You die!! BHAHAAHAHAHA" );
            System.out.println( "" );
            System.out.println( "" );
         }
        if (r3.equals("scream")) {
            System.out.println( "Guess what? You die!! BHAHAAHAHAHA" );
            System.out.println( "" );
            System.out.println( "" );
         }
        if (r3.equals("burn")) {
            System.out.println( "Guess what? You die!! BHAHAAHAHAHA" );
            System.out.println( "" );
            System.out.println( "" );
         }
        if (r3.equals("door")) {
            System.out.println( "Guess what? You die!! BHAHAAHAHAHA" );
            System.out.println( "" );
            System.out.println( "" );
         }
        if (r3.equals("window")) {
            System.out.println( "Guess what? You die!! BHAHAAHAHAHA" );
            System.out.println( "" );
            System.out.println( "" );
         }
        if (r3.equals("shoot")) {
            System.out.println( "Guess what? You die!! BHAHAAHAHAHA" );
            System.out.println( "" );
            System.out.println( "" );
         }
        if (r3.equals("run")) {
            System.out.println( "Guess what? You die!! BHAHAAHAHAHA" );
            System.out.println( "" );
            System.out.println( "" );
         }
            
    }
}

    


    

Picture of the output

Assignment 3
BACK HOME NEXT