Question: [IN JAVA] Write a program with a method isPerfect() and a method isPrime(). Each method has an int parameter and returns a boolean value indicating
[IN JAVA]
Write a program with a method isPerfect() and a method isPrime(). Each method has an int parameter and returns a boolean value indicating whether the parameter is perfect (or prime). (A perfect number is a number that is equal to the sum of its divisors, not including itself. For example, 6 is a perfect number, because its divisors are 1, 2, and 3, and 1 + 2 + 3 = 6.) In main(), repeatedly display a menu allowing the user to choose whether to display the prime numbers 1-1000, display the perfect numbers 1-10,000, or quit. Be sure to clearly label the output. Output the numbers 10 to a line.
Be sure to use good decomposition. main() should be around 11 lines of code or so.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
