Question: Java 2. Write a program that generates random factors. The user should enter a three digit number. Then the program should generate 4 numbers that
2. Write a program that generates random factors. The user should enter a three digit number. Then the program should generate 4 numbers that are factors of that number (excluding 1). If the number is a prime number the program should state that. (you should develop a function that check if the number is a prime, function that generates a number within an appropriate range and a function to generate a factor) Hint: A three digit number can have a maximum of 32 factors Sample run: Please enter a number (-1 to stop): 300 The random factors are 3,300,150,2 Please enter a number (1 to stop): 101 This number is prime Please enter a number (-1 to stop): -1 Thank you
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
