Hi All,
Here is hw3:
Write a program that computes all the prime numbers between 2
and 99 and store them in an array. Print the array.
Implement the below interface:
interface Prime {
int[] getPrimes(int a, int b);
void print(int[]);
}
A prime number is a whole number not divisible without a
remainder by any whole number other than itself and one.
Arrays cannot be grown in size, how will you
determine the correct size for the array upon your
return?
The array returned by getPrimes should have
a length that is equal to the number of prime numbers
between a and b. Finding the number of primes
is as hard as finding the primes!
|