Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- QUESTIONS.JAVA
- import java.util.Scanner;
- /**
- *
- * @author tharglet
- */
- public class Questions {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- boolean dontQuit = true;
- Scanner s = new Scanner(System.in);
- while (dontQuit) {
- System.out.println("What's your posion?");
- String input = s.nextLine();
- if (input.equals("cyanide")) {
- PoisonChoices.doCyanide();
- } else if(input.equals("warfarin")) {
- PoisonChoices.doRat();
- } else if (input.equals("quit")) {
- dontQuit = false;
- }
- }
- System.exit(0);
- }
- }
- POISONCHOICES.JAVA
- /**
- *
- * @author tharglet
- */
- public class PoisonChoices {
- public static void doCyanide() {
- System.out.println("Good Choice! Lovely Bottle!");
- }
- public static void doRat() {
- System.out.println("I didn't know you were a rat!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement