Question: in Java, with eclipse IDE. Write a method named isPrime, which takes an integer as an argument and returns true if the argument is a
in Java, with eclipse IDE.
Write a method named isPrime, which takes an integer as an argument and returns true if the argument is a prime number, or false otherwise.
Write a method named isEven that accepts an int argument. The method should return true if the argument is even, or false otherwise.
Write a method named isOdd that accepts an int argument. The method should return true if the argument is odd, or false otherwise. *** This method should use the 'isEven" method to calculate its result.
Write a main program which presents the user with the following Menu:
1) List Primes
2) Check Even
if a "1" is selected, list all of the prime numbers between 1 and 100.
If a "2" is selected, generate 100 random numbers and report if the number is even or odd. **** Use the isOdd function to test
The program ends once the output is displayed.
A prime number is a number that is evenly divisible only by itself and 1. For example, the number 5 is prime because it can be evenly divided only by 1 and 5. The number 6, however, is not prime because it can be divided evenly by 1, 2, 3, and 6.
Recall that the % operator divides one number by another, and returns the remainder of the division. In an expression such as num1 % num2, the % operator will return 0 if num1 is evenly divisible by num2.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
