Question: Hi I need help creating a program in JAVA applications. Create a program that randomly generates two numbers, then depending on a choice will Add,

Hi I need help creating a program in JAVA applications.

Create a program that randomly generates two numbers, then depending on a choice will Add, Subtract, Multiply or Divide the two numbers. The program should repeat the entire process until the user decides to quit. At the end display how many times the program repeated and how many correct answers were provided.

How to prevent division by zero generate two numbers if the second number is zero you can add 1 to it for this exercise. NOTE: you can divide into 0, but not by 0, so we are not worried about num1 being a zero..

How to prevent negative subtraction results; IF the second number is larger than the first number: int temp = num1; num1 = num2; num2 = temp;

How to only get whole numbers from division: do Not show problem until you do the next line int newDividend = num1 * num2; System.out.print(newDividend + " / " + num1 + " = " ) So of course the answer is now equal to num2...

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!