Question: Write a program that prompts the user for a number and outputs whether the number is prime. This should be done by creating a class
Write a program that prompts the user for a number and outputs whether the number is prime. This should be done by creating a class that asks for the number and reports the result and a second class that determines if the number is prime.
Examples:
Enter a number: 13 Thinking (this may take a while) The number 13 is prime.
Enter a number: 64000 Thinking (this may take a while) The number 64000 is composite (not prime).
Enter a number: 7919 Thinking (this may take a while) The number 7919 is prime.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
