Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.nciatronTg.shankshock.foobar;
- import java.util.Scanner;
- public class Main {
- /**
- * @param args
- */
- public static void main(String[] args) {
- askQuestion();
- }
- public static void askQuestion()
- {
- if (askQuestion("Do you like waffles?"))
- {
- System.out.println("Yay, waffles!");
- } else
- {
- if (askQuestion("Are you sure?"))
- {
- System.out.println("Fine!");
- }
- askQuestion();
- }
- }
- public static boolean askQuestion(String question)
- {
- Scanner input = new Scanner(System.in);
- String answer;
- System.out.println(question);
- answer = input.nextLine();
- if (answer.equalsIgnoreCase("Yes"))
- {
- return true;
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement