Program #74

Code

   
    /// Name: Afaf Nabeeha
    /// Period: 7
    /// Program Name: Adventure 2
    /// File Name: Adventure.java
    /// Date Finished: 1/29/2016 public class Adventure

        import java.util.Scanner;
        public class Adventure
        {
            public static void main( String[] args )
            {
                String a, a2, a3;
                int c;
                Scanner keyboard = new Scanner(System.in);
                System.out.println( "Afaf's Tiny Adventure 2! " );
                System.out.println();
                c = 1;
                do
                {
                System.out.println( "You have a free plane ticket to either Paris or Egypt. Where would you like to go. " );
                System.out.print( "> " );
                a = keyboard.next();
                if ( a.equals("Paris") )
                {
                    System.out.println( "You land in Paris. Would you like to go the \"Eiffel Tower\", the \"Louvre\", or go \"back\". " );
                    System.out.print( "> " );
                    a2 = keyboard.next();
                    if ( a2.equals("Eiffel"))
                        {
                            System.out.println( "Do you want to \"go up\" to the top or go \"back\". " );
                            System.out.print( "> " );
                            a3 = keyboard.next();
                            if (a3.equals("go up"))
                                {
                                    System.out.println( "You take beautiful pictures of the sunset from the top. " );
                                    c = 0;
                                }
                            else if ( a3.equals("back"))
                            {
                                c = 1;
                            }
                        }
                    else if ( a2.equals("Louvre"))
                    {
                        System.out.println( "You see the famous Mona Lisa, and want to keep it.  Do you try to \"steal it\" or go \"back\". " );
                        System.out.print("> ");
                        a3 = keyboard.next();
                        if (a3.equals("steal it"))
                        {
                            System.out.println("You successfully get away with the Mona Lisa, but live fugitively, as you are WANTED by Interpol. ");
                            c = 0;
                        }
                        else if (a3.equals("back"))
                        {
                            c = 1;
                        }
                    }
                                 
                }
                else if ( a.equals("Egypt") )
                {
                    System.out.println("You see the Spinx and want to sit on its back. Would you like to \"sit on it\" or go \"back\". " );
                    System.out.print("> ");
                    a2 = keyboard.next();
                    if (a2.equals("sit on it"))
                        {
                            System.out.println("You climb on and pretend you're a cowboy. Someone takes a video and you become an internet sensation. ");
                            c = 0;
                        
                        }
                    else if (answer2.equals("back"))
                             {
                                 c = 1;
                             }             
                }
                else 
                {
                    c = 1;
                }
                } while ( c != 0 );
            }
        }
             
    

Picture of the output

Assignment 77