Advertisement
scaawt

Second HW

Sep 21st, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.46 KB | None | 0 0
  1. /**
  2.  * Written by --
  3.  */
  4. import java.util.Scanner;
  5. public class Homework02 {
  6.  
  7.  
  8.   public static void main(String[] args) {
  9.     Scanner keyboard = new Scanner(System.in);
  10.         //Prompting the user
  11.        
  12.         System.out.println ("Welcome to the Zombie Escape Simulator! Would you like to start off in the city, suburbs, or the grocery store? Enter 'city', 'suburbs', or 'store'");
  13.         String one = keyboard.nextLine();
  14.         if (one.equals("city")) {          
  15.                 System.out.println ("You wake up from your apartment and you see zombies outside. Do you sleep it away or do you prepare for battle? Enter 'sleep' or 'prepare'");
  16.                 String two = keyboard.nextLine();                            
  17.                 if (two.equals("sleep")) {
  18.                     System.out.println("You chose to sleep. The zombies entered your apartment and swallowed you whole. The end.");
  19.                     System.exit(0);
  20.                 }          
  21.                 if (two.equals("prepare"))
  22.                     System.out.println("You gear up, and you make a break for it, but the dead are everywhere. Do you run for the alley or fight in the street? Enter 'alley' or 'fight'");
  23.                     String three = keyboard.nextLine();
  24.                     if (three.equals("alley")) {
  25.                     System.out.println("You run through the alley and you see someone pull around in a van and tells you to get inside. Do you join, or do you run? Enter 'join', or 'run'");
  26.                     }
  27.               if (three.equals("fight")) {
  28.                         System.out.println ("You literally fight to death and you do not make it. The end.");
  29.                         System.exit(0); }
  30.                    
  31.                     if (three.equals("join"))    
  32.                         System.out.println("You hop in the van with the woman and she says she's going back to her camp. Do you continue with her, or jump out of the van? Enter 'continue' or 'jump'");
  33.                         String four = keyboard.nextLine();
  34.                
  35.               if (four.equals("continue"))
  36.                 System.out.println("You make it to her camp, and you defend against zombies until the end of time. You win!");
  37.                    
  38.               if (four.equals ("jump")) {
  39.                             System.out.println("You jump out of the van, and you twist your ankle. Zombies see you and feast upon you. The end.");
  40.                             System.exit(0); } }
  41.                            
  42.        if (one.equals("suburbs"))
  43.                 System.out.println("You're reading a book in your room when you suddenly hear zombies approaching. Do you ignore them or drive off in your car? Enter 'ignore' or 'drive'");
  44.                
  45.               String uno = keyboard.nextLine();
  46.               if (uno.equals("ignore")) {
  47.                     System.out.println("You end up finishing your book, but the zombies devour you whole. The end.");
  48.                 System.exit(0); }
  49.                 if (uno.equals("drive"))  
  50.                     System.out.println("You barely bust through your garage and escape the zombies. Do you head for the woods, or head to the market for food? Enter 'woods' or 'market;");
  51.                    
  52.               String dos = keyboard.nextLine();
  53.                 if (dos.equals("woods"))
  54.                         System.out.println("You make it to the woods where you set up shop. At night, you hear a noise. Do you check it out, or ? Enter 'check' or 'stay'");
  55.                        
  56.               String tres = keyboard.next();
  57.               if (tres.equals("check")); {
  58.     System.out.println("You check out the noise, but a zombies comes from behind and eats you. The end");
  59.     System.exit(0); }
  60.                
  61.                 if (dos.equals("market"))
  62.                    System.out.println("You make it to the market, but you are overrun by the other living dead who also thought it was a good idea to go to the market. The end.");
  63.              
  64.  if (one.equals("store"))
  65.                 System.out.println("You are shopping for groceries when you see zombies enter the store! Do you continue to shop, or run for your life? Enter 'shop' or 'run'");
  66.                 String won = keyboard.nextLine();
  67.                 if(won.equals("shop")); {
  68.                 System.out.println("You check off your grocery list, but the zombies check theirs off by eating you. The end.");
  69.                 System.exit(0); }
  70.                
  71. }
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement