Question: Write all in 1java run 1) Generate two random numbers between 2 and 10. 2) Ask user to choose one operator from +,,,/ ( note:

Write all in 1java runWrite all in 1java run 1) Generate two random numbers between 2

1) Generate two random numbers between 2 and 10. 2) Ask user to choose one operator from +,,,/ ( note: / is an integer division) 3) Display Math formula using the numbers and the operator. ( eg: 67= ?) 4) Ask the user for an answer. - If the user's answer is correct, display "You are a math genius! Bye." and terminate the program. - If the user's answer is incorrect. Display "wrong answer!" and ask the user for the answer of the formular again. (Do not generate new numbers and formula.) 5) To calculate the answer, create a method and send/return the operator and two numbers. Like, public static int math(String op, int a, int b) \{ int result =0; if (op.equals(" + ") { result =;} return result; \} 6) you must pass 3 parameters (operator, first number, second number) to the math method and receive the result from the method. 7) Include appropriate program comments and formatting including: Your first and last name, a short description of the program's function comments necessary to explain the operation of your program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!