Advertisement
tharglet

Untitled

May 2nd, 2014
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1.  
  2. import java.util.Scanner;
  3.  
  4. /**
  5. *
  6. * @author tharglet
  7. */
  8. public class Questions {
  9.  
  10. /**
  11. * @param args the command line arguments
  12. */
  13. public static void main(String[] args) {
  14. boolean dontQuit = true;
  15. Scanner s = new Scanner(System.in);
  16. while (dontQuit) {
  17. System.out.println("What's your posion?");
  18. String input = s.nextLine();
  19. if (input.equals("cyanide")) {
  20. doCyanide();
  21. } else if(input.equals("warfarin")) {
  22. doRat();
  23. } else if (input.equals("quit")) {
  24. dontQuit = false;
  25. }
  26. }
  27. System.exit(0);
  28. }
  29.  
  30. private static void doCyanide() {
  31. System.out.println("Good Choice! Lovely Bottle!");
  32. }
  33.  
  34. private static void doRat() {
  35. System.out.println("I didn't know you were a rat!");
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement