/*
 * ArithmeticDrill.java     Authors: Koffman and Wolz
 * Generates and solves a multiplication problem
 */

import javax.swing.JOptionPane;

public class ArithmeticDrill {

   public static void main(String[] args) {
      // Generate 2 random integerss
      int multiplier = (int) (10 * Math.random() + 1);
      int multiplicand = (int) (10 * Math.random() + 1);
     
      // Calculate the product
      int product = multiplier * multiplicand;

      // Ask the user for the product
      String answerStr = 
          JOptionPane.showInputDialog("What is " + multiplier + 
                                      " * " + multiplicand);

      // Display the answer
      JOptionPane.showMessageDialog(null, 
             "The correct answer is " + product);
   }
}

