Question: Describe your program here. You must describe your program for a full credit. 4 . Design and implement a Python program that asks the user

Describe your program here. You must describe your program for a full credit.
4. Design and implement a Python program that asks the user to enter a positive
number and categorizes the number as composite or prime. A composite number
is a number with more than two factors including 1 and the number itself.
The first prime number is 2 and the first composite number is 4(10 pts).
Sample input and output
Input:
Enter a positive number: 0
Output:
0 is neither composite nor prime.
Input:
Enter a positive number: 1
Output:
1 is neither composite nor prime.
Input:
Enter a positive number: 2
Output:
2 is a prime number.
Input:
Enter a positive number: 4
Output:
4 is a composite number.
Input:
Enter a positive number: 9
Output:
9 is a composite number.
Input:
Enter a positive number: -2
Output:
-2 is not a positive integer.
Enter a positive number: a
a is not a positive integer.
Enter a positive number.
Hint: You must include user input validation for the program to pass the test.
Variable: number, is_prime
"""
# Write your code below this line

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!