1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Nonamiya [84]
2 years ago
5

A prime number is a number that is only evenly divisible by itself and 1. For example, the number 5 is prime because it can only

be evenly divided by 1 and 5. The number 6, however, is not prime because it can be divided evenly by 1, 2, 3, and 6. Write a Boolean function named is_prime which takes an integer as an argument and returns true if the argument is a prime number, or false otherwise. Use the function in a program that prompts the user to enter a number then displays a message indicating whether the number is prime.
here is a full explanation
• In order to do this, you will need to write a program containing two functions: • The function main() • The function isprime(arg) which tests the argument (an integer) to see if is Prime or Not.
step1 •
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.
step 2 • 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().
Computers and Technology
1 answer:
Advocard [28]2 years ago
4 0

Answer:

I need some time i answering your question please follow me and thank(sanybody have any friends cute girl or cute sardarni he is my classmate His name Was Kushi ask to Please follow me)

You might be interested in
. When attempting to minimize memory usage, the most efficient way to do group processing when using the MEANS procedure is to u
MrRissso [65]

Answer:

A. the BY statement.

Explanation:

The BY statement aids the procedure MEANS to develop the tree for the current BY group only, thereby analyze the stats, and clean the tree prior to the start and development of the next BY group.

However, without the BY statement, procedure MEANS develops its AVL tree for both the whole file and all sector estimates crossings established in CLASS.

Hence, in this case, the correct answer is the BY Statement.

8 0
3 years ago
Five types of conflict in the school​
MrRissso [65]

Answer:

Conflicts can be classified into five different types: structural, value, relationship, interest, and data [

Explanation:

5 0
3 years ago
Read 2 more answers
I need help now I really do what is the answer thank you
Svetradugi [14.3K]
The answer is c
just replace the y with the y value and the x with the x value
4 0
3 years ago
What is the recommended procedure for disconnecting an external hard drive to avoid losing data?
Zina [86]

Answer:

Instruct the operating system to eject the drive before unplugging it.

Explanation:

3 0
3 years ago
What is the purpose of the ISOWEEKNUM function?
Zarrin [17]
Answer is D
Stay safe !
3 0
3 years ago
Read 2 more answers
Other questions:
  • The _____ helps the project team to identify the main functions or features of the system and the different users or external sy
    15·1 answer
  • A computer program that senses when another computer is attempting to scan or access a computer or network is called an
    7·1 answer
  • Which of the following can be created when two tables contain a common field?
    14·1 answer
  • PLZ HELP ME! What is a false statement about online time?
    9·1 answer
  • Can Word Processing (WP) programs be used for DTP? Explain your answer
    7·1 answer
  • Keyboards that are widely used on various smartphones and other small portable devices, and which are designed primarily for com
    15·1 answer
  • Gina is driving her car down the street. She has a teddy bear sitting on the back seat. A dog runs in front of Gina's car, so sh
    15·2 answers
  • Secondary hard drive whats its purpose
    5·1 answer
  • The default for automatic replies in outlook is what?
    6·2 answers
  • Data is stored on ________ using a laser to either melt the disc material or change the color of embedded dye.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!