Question: Write a Java program that satisfies all the following requirements. (50 points) Include comments necessary to explain the operation of your program, and your functions

Write a Java program that satisfies all the following requirements. (50 points) Include comments necessary to explain the operation of your program, and your functions should be limited to those presented in chapters 1 to 5 of the textbook. 1) Ask user to input two integer numbers. (assume there is no input error) 2) Ask user to choose one operator from +, - (assume there is no input error) 3) Display Math formula using the numbers and the operator. (eg: 1 + 3 = ?) 4) Ask user to answer If the user's answer is incorrect. Display "wrong answer!" and ask the user for the answer of the formular again. If the user's answer is correct, display "You are a math genius!. Bye." and terminate the progarm. to calculate the answer, create a method and send/return the oprator and two numbers. Like, public static int math(String op, int a, int b) { int result = 0; if (op.equals("+") {result=...;} return result; } you must pass 3 parameters (operator, first number, second number) to the math method and receive the result from the method. Sample log: (user inputs are in bold and underlined) Input first number: 1 Input second number: 3 Select one from + - + What is 1 + 3 = ? 5 Wrong! What is 1 + 3 = 24 You are a math genius! Bye
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
