hey people. I need some tips on how to write the algorithm for this problem. If someone could please explain the idea and give me a framework for how to write the data algorithm for this then that would be great.
The following question is a twist on the age-old primality problem. Primality is defined on integers, and an integer
is prime if it is,
a. More than 1.
b. Divisible only by 1 and itself
The first few prime numbers are: 2, 3, 5, 7, 11, 13, ...
You are required to complete the method isAlmostPrime that when passed a positive integer, returns true if it
has exactly three positive divisors, and false otherwise. That is, the method returns true, if besides 1 and itself,
the integer has exactly one other positive divisor. For example, the method should return true for parameter 4,
since it has exactly three divisors: 1, 2, and 4. The method should return false for parameter 6, since it has four
divisors: 1, 2, 3, and 6.
The method should return false for any value less than 2 passed to it.