Package SolvishR

Class MultiplicationQuestion

java.lang.Object
SolvishR.Question
SolvishR.MultiplicationQuestion

public class MultiplicationQuestion extends Question
Represents a question related to multiplication. Extends the Question class and provides functionality to generate multiplication questions with random numbers.
Version:
1.0
Author:
Adib Sakhawat
  • Constructor Details

    • MultiplicationQuestion

      public MultiplicationQuestion(double number1, double number2)
      Constructs a multiplication question with specified numbers.
      Parameters:
      number1 - The first number.
      number2 - The second number.
    • MultiplicationQuestion

      public MultiplicationQuestion()
      Constructs a random multiplication question with numbers generated between 10 and 10000 (inclusive).
  • Method Details

    • checkAnswer

      public void checkAnswer(String givenAnswer)
      Checks the provided answer for correctness.
      Specified by:
      checkAnswer in class Question
      Parameters:
      givenAnswer - The answer provided by the user.
      Throws:
      NumberFormatException - If the provided answer is not a valid number.
    • show

      public void show()
      Displays the multiplication question.
      Specified by:
      show in class Question