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
Which of the following would you not see on a windows 10 start menu?
mixas84 [53]
Task view is the option that you would not see on a Windows 10 Start menu, whereas if you click the Windows button, you can see tiles with different applications, all of your apps in the form of tiles you can distribute according to your own taste, and power button where you can choose whether you want to shut down your computer, put it to sleep, or log out.
4 0
2 years ago
Brake fluid is made up of a chemical that
Sidana [21]

Answer:

Most brake fluids used today are glycol-ether based, but mineral oil (Citroën/Rolls-Royce liquide hydraulique minéral (LHM)) and silicone-based (DOT 5) fluids are also available.

Explanation:

4 0
3 years ago
To navigate through your presentation slides, which key on your keyboard can you use?<br> Dankonace
jekas [21]

Answer:

You use your arrow keys

Explanation:

4 0
3 years ago
2 The software needed to send an email is:
Alexxx [7]

Answer:

C communication software

Explanation:

C communication software IS THE ANSWER

8 0
3 years ago
1 Which skill-based video game requires quick reflexes and skills with weapons?
kirill [66]

The Answer to Number 1 is Shooter Games

The Answer to Number 2 is Dice Throwing

The Answer to Number 3 is Games are organized play

The Answer to Number 4 is Either Simulation or Adventure

The Answer to Number 5 is Stories have no rules to follow, you can learn from countless other lifetime through stories

The Answer to Number 6 is Setting

The Answer to Number 7 is False

The Answer to Number 8 is Objective

7 0
2 years ago
Other questions:
  • a supermarket having a sale on canned foods' the sale includes 12 cans of soup for 10.65 what is the unit price per can of soup
    6·2 answers
  • What are some examples of environmental technology
    8·1 answer
  • manufacturers are making an effort to build energy-efficient computers and use recyclable cases and packaging true or false
    10·1 answer
  • Graphic images can be stored in a variety of formats including ____.
    15·1 answer
  • Anna is looking for a job. Which two types of skills would she find necessary to secure a job ?
    5·1 answer
  • Which of the following are examples of how a company might use consumer data it had collected? a To decide what types of product
    10·1 answer
  • How would you compare and contrast the impact of the printing press with the impact of the internet?
    15·1 answer
  • How is modern technology developed? Explain.
    14·2 answers
  • When right-clicking an object, a ____ menu appears, which contains frequently used commands related to the object.
    7·1 answer
  • Radio spectrum is the part of the complete range of electromagnetic waves that is used for radio communication from
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!