Assignemnt #45 and an Adventure

Code

/// Name: Kyle Ivy
/// Period: 5
/// Program Name: Adventure
/// File Name: Adventure.java
/// Date Finished: 12/2/2015

 import java.util.Scanner;
    
    public class Adventure
    {
        public static void main( String[] args )
        {
            Scanner keyboard = new Scanner(System.in);
            String firstAnswer, secondAnswer, thirdAnswer;
            
            System.out.println("Welcome to the future. ");
            System.out.println( "You have the option to become an astronaut. Do you accept or decline? " );
            firstAnswer = keyboard.next();
            
            if ( firstAnswer.equals( "accept" ))
            {
                System.out.println( "After months of training, your mission to mars leaves in a week. You are woken early in the morning by a mysterious figure looming over your bed. He claims to be a time traveler and has come to warn about your mission. He says NASA has been lying to you and you should take caution in opening their third set of instructions. Do you tell NASA about your visitor? Type yes or no." );
                
                secondAnswer = keyboard.next();
                
                if (secondAnswer.equals( "no" ))
                {   
                    System.out.println( "It's now been 17 days into your mission. You are safely on your way to Mars. You've already receieved two sets of instruction, and a message pops up on your heads up display. It's the third set of instructions. Do you open them? Type yes or no." );
                    
                    thirdAnswer = keyboard.next();
                    
                    if ( thirdAnswer.equals( "yes" ))
                    {
                        System.out.println( "You open the instructions. Quickly you realize someone had hacked into NASA's systems, as your ship has reprogrammed it's flight path and is now on a crash collision with Earth. You have 20 days until your ship takes out half of the Western Hemisphere. After sending messages to your wife, you and your crewmates blow the hatches, realsing your bodies into the quiet vaccum of space." );
                    }
                    
                    else if ( thirdAnswer.equals( "no" ))
                    {
                        System.out.println( "It turns out your crewmates also receieved the same warning as you did, and decided not to inform NASA just like you. Although you want desperately to know what the 3rd set of instructions said, you push on towards Mars. Your descent goes smoothly, and you and your crewmates crowd the hatch door, awaiting Mars. You will be the first astronaut to set foot on another planet." );
                    }
                }
                else if (secondAnswer.equals( "yes" ))
                {
                    System.out.println( "You decide to tell NASA about the visitor. The other crewmates also reported seeing someone suspicious. Your mission is delayed, and eventually a new set of crew is selected. Your career as an astronaut is in the past, and you find work as a mechanical engineer. 15 years in the future, you and your colleagues thought you have invented time travel, but keep it a secret from the public for fear of its damaging consequences. You volunteer to be the first time traveler the world has known. Your question is: Do you have to go back in time and warn yourself as a young astronaut to heed NASA's instructions? yes or no? Things to think about: If you didn't tell NASA about the visitor in the past, would you invent time travel at all becasue you never become a mechanical engineer? Would you be risking your own timeline? Once the decision is made, is your present affected instantly?");
                    thirdAnswer = keyboard.next();
                    
                    if ( thirdAnswer.equals( "yes" ))
                    {
                        System.out.println("You go back in time to warn your past self about NASA. The experience is unnerving but when you return to your present everything is as it was. You've saved your timeline, and have become the first time traveler. Eventually your time travel technology is taken  by the government, and by foreign governments. They come to use it as a privatized weapon, waging war against their enemies of the past to make a more proserous futurem in their minds. However, you see it as the sacrifice of past lives for the advancement of power for a few in the present. You know this can't go on forever, and eventually one version of the past see complete world war with consequences too dire to fix. Your invention has doomed the human race.");
                    }
                    else if ( thirdAnswer.equals( "no" ))
                    {
                        System.out.println( "You decide instead to go back and witness the MARS flight of the crew that replaced you. You're in NASA HQ, listening to their communications with the crew. When the time comes for them to execute the third set of instructions, they ignore it, as the visitor told you to do. The NASA HQ is in turmoil over the denied instructions from the crew, and in the chaos you witness the impossible. You see yourself run into the HQ and slip a flashdrive into the side of a computer. Suddenly, the third set of instructions are executed, despite the crews defiance. Another version of you had gone back to ensure that this happened. You can't warn anyone for fear that you will further distort the timeline. The ship is now on a crash course towards Earth, set to go so fast on impact it will wipe out humanity. Desperate for answers, you chase down the alternate version of yourself and before he quickly explains how your gift of time travel will be abused to doom humanity, and that this way the astronauts on Mars have a chance to carry on the human race before he vanishes with a buzz of mechanical whirring. Your stay in this time is over now, and once you attempt to warp back to your own present you obliterate into nothing, as you have gone forward to a time where you can no longer exist." );
                    }
                }
            }
            else if ( firstAnswer.equals( "no" ))
                {
                    System.out.println( "Really? Your life as a Taco Bell manager is impossibly dull compared to the altrnate version of your life. You hear a loud boom that is followed by screams one night as you are working late in your office. Do you go to investigate? yes or no." );
    
                    secondAnswer = keyboard.next();
    
                    if (secondAnswer.equals( "yes" ))
                    {   
                        System.out.println( "As you run downstairs you see a man draped in dark clothing making his away out of the parking lot. Do you wait for him to leave to investigate?" );
    
                        thirdAnswer = keyboard.next();
    
                        if ( thirdAnswer.equals( "yes" ))
                        {
                            System.out.println( "You run out to find a bloody hole-ridden corpse on the ground with no sign of anything else in sight. You try to ID this shell of a person and as you hunch over to search their pockets. You hear a deep sigh as you get blasted back into a wall. You look up in your last moments to see yourself holding a 12 gauge. He laughs and explains that he must kill the weak versions of himself in alternate timelines to make sure the best version of him sees full potential. As you hear him rant on, you feel the cold release of death. Boo." );
                        }
    
                        else if ( thirdAnswer.equals( "no" ))
                        {
                            System.out.println( "You choose to confront the man. Maybe he isn't  involved and witnessed something? After all it did take you quite a while to get down to the floor level. You run out to ask him if he knows what happens, and you are blasted in the stomach with a shotgun blast. You look up in your last moments to see yourself holding a 12 gauge. He laughs and explains that he must kill the weak versions of himself in alternate timelines to make sure the best version of him sees full potential. As you hear him rant on, you feel the cold release of death and think of how pathetic your life has been and that maybe he was right. It would have been cool to become an astronaut, you think to yourself as your mind fades into eternal darkness. You're dead." );
                        }
                    }
                    else if (secondAnswer.equals( "no" ))
                    {
                        System.out.println( "You choose to stay denned up in your office. The next day you find out that there was a shooting outside the building and feel terrible about not doing anything about it. Years go by, your wife divorces you, and takes the kids. You are a grumpy old man with many regrets. You want your life to mean something, so you think about flying to India as a construction manager to build schools and hospitals. Do you want to go to India?");
                        thirdAnswer = keyboard.next();
                        
                        if ( thirdAnswer.equals( "no" ))
                        {
                            System.out.println("Wow you have a habit of making boring decisions, so you get a boring story. You die alone and sad of a heart attack while watching a program about a manned mission to Mars.");
                        }
                        else if ( thirdAnswer.equals( "yes" ))
                        {
                            System.out.println( "You go to India but don't really have the qualifications you believed you needed to become a construction manager. You adopt a young child and hope to make his life better than yours. He loves veerything math and science, and everytime anyone asks what he wants to be when he gorws up, he proudly responds that he would be an astronaut. You doubt your life choices..." );
                    }
                }
            }
        }
    }
    

prog45.PNG

Assignment 1