Question: Create a Java application that will prompt the user for how many prime numbers they would like to see. The program will then generate that

Create a Java application that will prompt the user for how many prime numbers they would like to see. The program will then generate that many prime numbers, store them in an array, and output the contents of that array back to the user The program must generate the prime numbers from scratch Requirements: Your program asks the user how many prime numbers they would like - declare an array of that size The array will hold the actual numbers that you find to be prime Use a loop to generate potential prime numbers and test if that number is in fact prime. If it is, write that number to the array. The loop should keep generating possible prime numbers, testing them, and adding correct primes to the array until the number of primes generated satisfies how many the user asked for. Once the array has been filled, use a for loop to output the numbers in the array back to the user. What do we already know about primes? A prime number is a number that is only divisible by one and itself. Aside from the number 2, we know that only odd numbers are prime, so there is no reason to include even numbers in your search. I don't mind if you go ahead and set the first prime number as 2, but the all of the following should come from you testing possible prime candidates in a loop
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
