I recieved an assignment in my Java class recently to write a program that will find & display a bunch of prime numbers. I know what a prime number is, and I know how to find them, given a deffinite range (between 1 and x) and if I can do it on my own - writing it out on a piece of paper, or something similar - but I'm not quite sure how to implement something like this in a program. Here are the specific instructions:
Write a program that meets the following requirements:
1)Declare a method to determine whether an integer is a prime number. Use the flowing method declaration:
public static boolean isPrime(int num)
2) Use the isPrime method to find first 1000 prime numbers, and display every 10 prime numbers in a row as follows:
2 3 5 7 11 13 17 19 23 29
31 37 41 43 47 53 59 61 67 71 ...
I'm stumped 😕
Nate
Write a program that meets the following requirements:
1)Declare a method to determine whether an integer is a prime number. Use the flowing method declaration:
public static boolean isPrime(int num)
2) Use the isPrime method to find first 1000 prime numbers, and display every 10 prime numbers in a row as follows:
2 3 5 7 11 13 17 19 23 29
31 37 41 43 47 53 59 61 67 71 ...
I'm stumped 😕
Nate