Question
Step 1 - Use Textpad or another compiler to create a java program called MathQuestions. Save it with file name MathQuestions.java.
Step 2 - Update the MathQuestions application to use methods to capture data from the user, and create math problems. You will need convert the existing application above to use at least 3 methods in your application.
Capture the active window screen capture, which has the output of the updated MathQuestions; insert it into this document.
Attach a copy of the update MathQuestions Source Code.
Solution Preview
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.
public static void main(String[] args){/* Declare Constant variables */
final int ADDITION = 1;
final int SUBTRACTION = 2;
final int MULTIPLICATION = 3;
final int DIVISION = 4;
/* Declare local variable */
int problemType = readProblemType();
boolean answer = false;
if (problemType < ADDITION || problemType > DIVISION ) {
JOptionPane.showMessageDialog(null, "You should choose correct type of Math Problem.");
System.exit(1);
}
int mathVar1 = getData(1);
int mathVar2 = getData(2);
int userAnswer = readAnswer(mathVar1, mathVar2, problemType);
switch(problemType){...