Advertisement
scaawt

CSCE HW02

Sep 14th, 2018
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.06 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4. public class Main {
  5.  
  6.     public static void main(String[] args) {
  7.     Scanner keyboard = new Scanner(System.in);
  8.         //Prompting the user
  9.         System.out.println ("Welcome to the Zombie Escape Simulator! Would you like to start off in the city, suburbs, or rural area? Enter 'city', 'suburbs', or 'rural'");
  10.         String city = keyboard.nextLine();
  11.             if (city == city)
  12.             {
  13.                 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'");
  14.                 String sleep = keyboard.nextLine();
  15.                 String prepare = keyboard.nextLine();
  16.                 if (sleep.equalsIgnoreCase(prepare))
  17.                 if (prepare.equalsIgnoreCase (sleep))
  18.  
  19.                 if (sleep == sleep) {
  20.                     System.out.println("You chose to sleep. The zombies entered your apartment and swallowed you whole. The end.");
  21.                 }
  22.  
  23.                 {
  24.                 if (prepare == prepare){
  25.                     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'");
  26.                     String alley = keyboard.nextLine();
  27.                     String fight = keyboard.nextLine();
  28.  
  29.                 if (alley == alley) {
  30.                     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'");
  31.                 }
  32.  
  33.                     {
  34.                 if (fight == fight) {
  35.                         System.out.println ("You literally fight to death and you do no make it. The end.");
  36.                     {
  37.  
  38.                     }
  39.                     if (alley.equalsIgnoreCase(fight))
  40.                     if (fight.equalsIgnoreCase(alley));
  41.                     }
  42.                     }
  43.                 }
  44.  
  45.                 }
  46.         }
  47.  
  48.     }
  49.  
  50.  
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement