Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Homework 5A The following is a description of what each function should do main() will be designed to do the following On the first line

image text in transcribed
Homework 5A The following is a description of what each function should do main() will be designed to do the following On the first line you will print out: "My Name's Prime Number Checker You will ask that an integer be typed in from the keyboard You will check to be sure that the number (num) is equal to or greater than the integer 2. If it isn't, you will be asked to re-enter the value You will then call the function isprime(num), which is a function which returns a Boolean Value (either True or False). You will then print out the result that the function returned to the screen, which will be either: If the function returned True, then print out num "is Prime", or If the function returned False, then print out num "is Not Prime" Your entire main) function should be contained in a while loop which asks you, at the end, if you would like to test another number to see if it is Prime. If you type in "y", then the program runs again. isprime(arg) will be designed to do the following It will test the argument sent to it (nuM in this case) to see if it is a Prime Number or not The easiest way to do that is to check to be sure that it is not divisible by any number, 2 or greater, which is less than the value of nuM As long as the modulo of nuM with any number less than it (but 2 or greater) is not zero, then it will be Prime, otherwise it isn't. * Return the value True, if it is Prime, or False if it is not Prime . Call this program: YourName-HwrkSA. Homework-5B This exercise assumes that you have already written the isprime function, isprime(arg), in Homework-5A Write a program called: YourNameHwrk5B.py, that displays all the prime numbers from 2 to whatever integer that you type in Your main() function should start by printing your name at the top of the display (e.g. "Charlie Molnar's Prime Number List") This program should have a loop that calls the isprime() function, which you include below the function main()

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

Step: 3

blur-text-image

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

Database And Expert Systems Applications Dexa 2022 Workshops 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 In Computer And Information Science 33

Authors: Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil ,Bernhard Moser ,Alfred Taudes ,Atif Mashkoor ,Johannes Sametinger ,Jorge Martinez-Gil ,Florian Sobieczky ,Lukas Fischer ,Rudolf Ramler ,Maqbool Khan ,Gerald Czech

1st Edition

3031143426, 978-3031143427

More Books

Students also viewed these Databases questions

Question

13. Give four examples of psychological Maginot lines.

Answered: 1 week ago

Question

Identify three types of physicians and their roles in health care.

Answered: 1 week ago

Question

Compare the types of managed care organizations (MCOs).

Answered: 1 week ago