Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need to write a Java program for this problem: A prime number is a number that

ID: 3651135 • Letter: I

Question

I need to write a Java program for this problem:
A prime number is a number that is only evenly divisible by itself and 1. For example the number 5 is prime because it can only be evenly divided by 1 and 5. The number 6 however is not prime because it can be divided evenly by 1,2,3, and 6.

Design a Boolean function named isPrime, which takes an integer as an argument and returns True if the argument is a prime number, or FALSE otherwise. Use the function program that prompts the user to enter a number and then displays a message indicating whether the number is prime.
It also needs a loop to let the user enter a number more than one time for a test

Thanks for the help!!

Explanation / Answer

Pseudo code Function main //No arguments passed to main function Pass In: nothing //Declare variables Declare Integer number Declare Boolean result //Get the number Display “Enter an integer number” Input number //value returned by call to isPrime (number) function assigned to result result = Call: isPrime Pass In number If result is equal to True Then Display “number is prime” Else Display “number is non prime” End if //nothing (value zero) is returned by main to operating system Pass Out: value zero to the operating system End function Function isPrime //number is argument in this function Pass In: integer number //Declare variables Declare Integer count Declare Boolean prime count = two prime = True //while loop While count