Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a Java program to generate 10 random numbers between 0 and 99, figure out the prime numbers in them, and count the number
Write a Java program to generate 10 random numbers between 0 and 99, figure out the prime numbers in them, and count the number of prime numbers (hint: consult Section 5.11 in the Textbook on finding prime numbers). The program should implement an is Prime method to test if a number is a prime number as follows: public class HW6_2 { } public static void main(String[] args) { ..... } public static boolean isPrime (int n) The following are two sample runs of the program: Sample run 1 Ten random numbers are: 64 87 92 41 92 19 83 63 87 73 The prime numbers in the list are: 41 19 83 73. The number of prime numbers: 4 Sample run 2 Ten random numbers are: 16 20 68 84 90 18 19 9 65 53 The prime numbers in the list are: 19 53 The number of prime numbers: 2
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Below is a simple Java program that generates 10 random numbers between 0 and 99 finds the prim...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started