Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Java image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

2. Explain grades or test results.

Answered: 1 week ago

Question

How is the education level required for a position established?

Answered: 1 week ago

Question

Why is a job analysis important?

Answered: 1 week ago