Write java program that generate two integer random numbers between 15 and 43 and print out the result of four operations between the two numbers, addition, subtraction, multiplication, division.
Write java program that generate two integer random numbers between 15 and 43 and print
out the result of four operations between the two numbers, addition, subtraction,
multiplication, division.
The program must have the following methods:
1- Method to generate a random number and return it.
2- Method for addition operation accept two numbers and return back the result of
addition operation.
3- Method for subtraction operation accept two numbers and return back the result of
subtraction operation.
4- Method for multiplication operation accept two numbers and return back the result of
multiplication operation.
5- Method for division operation accept two numbers and return back the result of division
operation.
6- Method to display the operation result which accept a string and three numbers.
7- Main method to run the program by calling the above methods.
Step by step
Solved in 3 steps with 1 images