Question: Question 3 : Create a program that checks whether a number ( between 1 and 5 0 0 0 , exclusive ) is a prime
Question : Create a program that checks whether a number between and exclusive is a prime number and displays the total number of factors if it is not a prime number. Use the screenshot as a reference. pts
Prime Number Checker
Please enter an integer between and :
Invalid integer. Please try again.
Please enter an integer between and :
mathrm is a prime number.
Try again? yn: y
Please enter an integer between and :
is a prime number.
Try again? yn: y
Please enter an integer between and :
is NOT a prime number.
It has factors.
Try again? yn: y
Please enter an integer between and :
is NOT a prime number.
It has factors.
Try again? yn: n
Bye!
a A prime number is only divisible by two factors and itself For example, is a prime number because it is only divisible by and If the number is not a prime number, the program should display its number of factors. For example, has four factors and pts
b Store the code that gets a valid integer for this program in its own function. pts
Assume the user will enter an integer. However, if the number is out of range, display this message: "Invalid integer. Please try again."
c Store the code that calculates the number of factors for a number in its own function. pts
d Store the rest of the code that gets input and displays output in the main function. If needed, divide this code into functions whenever you think it would make that code easier to read and maintain. pts
The program should continue only if the user enters y or Y to continue.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
