Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.08 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Lab4Problem3StewartSpencer {
  4.  
  5. public static void main(String[] args) {
  6. Scanner stdin = new Scanner(System.in);
  7. int choice,choice12=0,choice13=0,choice14=0,choice15=0, choice1 = 0, choice2 = 0,choice3 = 0,choice4 = 0, choice5=0,choice6 =0, choice7= 0,choice8 =0,choice9 =0,choice10=0,choice11 =0;
  8.  
  9.  
  10. System.out.println("Welcome to your adventure! Have a wonderful stay!");
  11. System.out.println("You are approaching a house, would you like to go (1) inside or (2) outback?");
  12. choice = stdin.nextInt();
  13.  
  14.  
  15.  
  16. if (choice == (1))
  17. {
  18. System.out.println(" The house is empty, would you like to check the (1) kitchen or the (2) upstairs?");
  19. choice1= stdin.nextInt();
  20. }
  21. else if (choice == (2))
  22. {
  23. System.out.println("There is a grave outback, would you like to (1) check it out or go in through the (2) backdoor?");
  24. choice2= stdin.nextInt();
  25. }
  26. if (choice1 ==1)
  27. {
  28. System.out.println("You go into the kitchen and find a person standing there, do you want to (1) approach him or (2) ignore him?");
  29. choice4= stdin.nextInt();
  30. }
  31. if (choice4==1)
  32. {
  33. System.out.println("You approach him and he starts swinging at you with his fist so you fight back. You knock him out and he hits his head on the corner of the table and is now dead. Do you want to (1) leave him or (2) call the police?");
  34. choice13= stdin.nextInt();
  35. }
  36. if (choice13== 1)
  37. {
  38. System.out.println("You start running for your life back to your house.");
  39. }
  40. else if (choice13==2)
  41. {
  42. System.out.println("The police show up and you explain to them what happened, you are now under arrest for manslaughter.");
  43. }
  44. else if (choice4==2)
  45. {
  46. System.out.println("You ignore the guy and move onto the next room.Do you want to turn on the (1) fan or (2) lights?");
  47. choice14= stdin.nextInt();
  48. }
  49. if (choice14==1)
  50. {
  51. System.out.println("You turn on fan and it falls on you killing you.");
  52. }
  53. else if (choice14==2)
  54. {
  55. System.out.println("You turn on the lights and there is an electrical problem causing the house to catch on fire, you sucessfully escape the fire!");
  56.  
  57. }
  58. else if (choice1 == 2)
  59. {
  60. System.out.println("You go upstairs and find a chest, do you want to (1) open it or (2) ignore it and go into the other room?");
  61. choice3 = stdin.nextInt();
  62. }
  63. if (choice2 ==1)
  64. {
  65. System.out.println("You check out the grave and there is a person standing in it, do you want to (1) approach him, or (2) bury him alive?");
  66. choice5 = stdin.nextInt();
  67. }
  68. if (choice5 ==1)
  69. {
  70. System.out.println("You approach the guy he has a knife, do you want to (1) fight him or (2) flee?");
  71. choice10= stdin.nextInt();
  72. }
  73. if (choice10== 1)
  74. {
  75. System.out.println("You fight him and you are now DEAD");
  76. }
  77. else if (choice10 ==2)
  78. {
  79. System.out.println("You leave the property forever and never come back again!");
  80. }
  81. else if (choice5 ==2)
  82. {
  83. System.out.println("You bury him alive, leaving no remains. Do you want to (1) leave the property now or (2) call 911?");
  84. choice15= stdin.nextInt();
  85. }
  86. if (choice15 ==1)
  87. {
  88. System.out.println("You leave the property and never return again.");
  89. }
  90. else if (choice15==2)
  91. {
  92. System.out.println("You call 911 and leave the premises forever.");
  93. }
  94. else if (choice2 == 2)
  95. {
  96. System.out.println("You go into the backdoor and there is a person standing there do you want to (1) approach him or (2) ignore him and go into the living room?");
  97. choice7 = stdin.nextInt();
  98. }
  99. if (choice7 ==1)
  100. {
  101. System.out.println("You approach him and he has a blade, do you want to (1) fight him or (2) flee?");
  102. choice11= stdin.nextInt();
  103. }
  104. if (choice11==1)
  105. {
  106. System.out.println("You fight him and you lost, you are now dead.");
  107. }
  108. else if (choice11 ==2)
  109. {
  110. System.out.println("You flee the property forever to never comeback");
  111. }
  112. else if (choice7==2)
  113. {
  114. System.out.println("You ignore him and go into the living room. Do you want to (1) turn the fan on or (2) the light switch?");
  115. choice12= stdin.nextInt();
  116.  
  117. }
  118. if (choice3 ==1)
  119. {
  120. System.out.println("Inside the chest you find 1 million dollars do you want to (1) take it and leave the house, or (2) ignore it and move onto the next room?");
  121. choice8 =stdin.nextInt();
  122. }
  123. if (choice8 ==1)
  124. {
  125. System.out.println("You take the money and leave the house forever!");
  126. }
  127. else if (choice8 ==2)
  128. {
  129. System.out.println("You ignore it and go into the next room, but when you do so you step on trip-wire and the whole house explodes!");
  130. }
  131. else if (choice3 == 2)
  132. {
  133. System.out.println("You ignore the chest and go into the other room, do you want to turn on the (1) tv or (2) radio?");
  134. choice9 = stdin.nextInt();
  135. }
  136. if (choice9 == 1)
  137. {
  138. System.out.println("You turn on the TV and it is a bomb and you die.");
  139. }
  140. else if (choice9 ==2)
  141. {
  142. System.out.println("You turn on the radio and it is actually a turret that shoots you and you die");
  143. }
  144. }
  145. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement