Question: Use Java language You are to write a program to find all of the prime numbers between randomly chosen minimum and maximum values. You should

Use Java language

You are to write a program to find all of the prime numbers between randomly chosen minimum and maximum values. You should write a class PrimeFinder.

This class should have a public static method called isPrime. This method returns a boolean value and takes in int parameter, testNumber.

This method returns true if testNumber is a prime number, and false otherwise. This method does not have a println call. This class should have a public static method floor that takes no parameters and returns an int that is randomly chosen, positive, and less than 1000.

This class should have a public static method ceiling. This method takes an int parameter, lowBound, and returns an int value. The returned value is randomly chosen, and greater than lowBound (but note, to make sure our program finishes before the course is over, let's make the returned value random, but less than lowBound * 10).

You should write a class PrimeCalc. This class should have a main method that uses floor and ceiling to establish a range of numbers to check for being prime.

prints the floor and ceiling values.

loops through the potential prime numbers,

using isPrime to determine whether each is a prime number.

prints the prime numbers prints the number of prime numbers found

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!