title: Java Multiplication Expression Generator
body: <p>The goal of this assignment is to generate a multiplication problem in class Multiplier to display in GameTester so that the user may input an answer. If incorrect 3 times, it will display the correct answer and then prompt whether or not they would like to play again. My overall issue is after they solve or fail to solve the problem and I prompt the next question they are unable to answer. I am looking for a more efficient way to display another question so that it is more fluid and continuous in the program.</p>
  
  <pre><code>import java.util.Scanner;
  public class GameTester{
  
      public static String question;
    public static void main(String[] args){
      Multiplier m = new Multiplier();
      Scanner s = new Scanner(System.in);
      question = m.generateProblem();
      System.out.println(question);
      int userAnswer = s.nextInt();
      if(userAnswer == m.checkAnswer()){
          System.out.println("Correct!! Want to play again?");
          s.nextLine();
          String user = s.nextLine();
          playAgain(user);
      }
      else {
          System.out.println("Sorry, the answer is incorrect. Try again!");
          s.nextLine();
          for(int i = 0; i &lt;=1; i++){
          System.out.println(question);
          if(i != 1 &amp;&amp; s.nextInt() != m.checkAnswer()){
              System.out.println("Sorry, the answer is incorrect. Try again!");
          }
          else if(i == 1 &amp;&amp; s.nextInt() != m.checkAnswer()){
              System.out.println("The correct answer was " + m.checkAnswer());
              System.out.println("Want to play again?");
              s.nextLine();
              String user = s.nextLine();
              playAgain(user);
          }
          else{
              System.out.println("Correct!! Want to play again?");
              s.nextLine();
              String user = s.nextLine();
              playAgain(user);
          }
          }
      }
  }
  
    public static void playAgain(String userInput){
        if(userInput.equals("yes")){
            Multiplier m2 = new Multiplier();
            question = m2.generateProblem();
            System.out.println(question);
        }
        else{
            System.exit(0);
        }
    }
  }
  
  import java.util.Random;
  public class Multiplier{
  
      public static int product;
  
  
    public Multiplier(){
  
    }
  
    public static String generateProblem(){
      Random r = new Random();
      int term1 = r.nextInt(11);
      int term2 = r.nextInt(11);
      product = term1 * term2;
      String s = "How much is " + term1 + " times " + term2 + "?";
      return s;
    }
  
    public static int checkAnswer(){
        return product;
    }
  
  }
  </code></pre>