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
9. h=
Nadya [2.5K]

Answer:

rs 35.6ko vrs 12. r7 3.3ko vrt 13.

6 0
2 years ago
Jennifer stays fit by playing games that track the movement of her body. Which platform features such a physical interface featu
Usimov [2.4K]

Answer:

kinect xbox 360.

Explanation:

for example- just dance

7 0
3 years ago
For each of the following cases, select the type of NoSQL DBMS that would fit best the needs of the situation. a. The database h
ohaa [14]

Answer:

Check the explanation

Explanation:

(a) There will be a need for the database to support a comparatively complex and complicated hierarchical internal record structure that may vary for each record. Column store NoSQL DBMS

(b)The key requirements for the database are to access a specific record structure as quickly as possible without any concern regarding the internal structure of the record. Key value store NoSQL DBMS

(c) The data are specifically well suited to be organized as a network of connections amid the data items. Graph Base NoSQL DBMS

(d) It is essential that the DBMS offers quick access to each of the records by a key value, but, in addition, it has to also allow easy access to the components of each record. Document store NoSQL DBMS

4 0
3 years ago
How do the World Wide Web and the Internet work together?
Firlakuza [10]

Answer:

Explanation:

The relationship between the World Wide Web and the Internet is that the Internet is a collection of connected computers through gateways by which the information that is stored in databases and on servers is transferred from one computer to another and the World Wide Web is the software that is used to retrieve the information requested by the users.  The World Wide Web (which we call the Web because we’re lazy typists) lives “on top of” the Internet. The Internet’s network is at the core of the Web, and the Web is like an attractive parasite that requires the Net for survival (dummies.com, 2010).  The Web page that are accessible on the web usually contain hypertext links and are sometimes called links. These links connect to other pages that are store on the same or even a different server; these servers can be in any location throughout the World.  This system of interlinked documents is known as hypertext (Dummies.com, 2010).

Links can create connections that let you go directly to related information. These invisible connections between pages are like the threads of a spider web — as you click from Web page to Web page, you can envision the Web created by the links. What’s so remarkable about the Web is that it connects pieces of information from all around the planet, on different computers and in different databases (Dummies.com, 2010).  Every Web page has a name attached to it so that browsers, and you, can find it. The name of this naming convention: URL, or Uniform Resource Locator. Every Web page has a URL, a series of characters that begins with http://. (Pronounce each letter, “U-R-L” — no one says “earl.”), (Dummies.com, 2010).  The Internet is a world wide network of computers that are connected (networked) and are using the communication method called TCP/IP. The Internet was named ARPANET in 1969 by the Advanced Research Projects Agency of the U.S. Department of Defence with just four computers connected together (Comentum.com, 2010).  The Internet, sometimes called simply “the Net,” is a worldwide system of computer networks – a network of networks in which users at any one computer can, if they have permission, get information from any other computer (SearchWinDevelopment.com, 2010).  Computers are connected to the Internet via modems and gateways. Some computers are used as servers which are continuously connected to the Internet and used to store web pages; these computers are usually referred to as servers. A house hold computer is primarily used by ordinary people to search for information on the web is usually known as a client. The request for information or search result is passed by the browser on the client to the server that contains the pages which have the relevant information in them via the net. The request passes through the modem then along the net to the correct server, the server then serves up the correct page, which is then sent back to client computer and presented to the user through the browser.

5 0
3 years ago
Write a program for TIC TAC TOE in PYTHON
masya89 [10]

Answer: much too long to write here: see attached

Explanation:

3 0
3 years ago
Other questions:
  • What are the elements of an autobiographical narrative similar to those of a short story?
    7·1 answer
  • It takes 2 seconds to read or write one block from/to disk and it also takes 1 second of CPU time to merge one block of records.
    10·1 answer
  • Need 2.5 Code Practice Answers
    14·2 answers
  • A​ ___________ identifies the content and purpose of the​ visual, along with whatever label and number​ you're using to refer to
    15·1 answer
  • How are traditional technology and modern technology related to each<br>other? ​
    9·2 answers
  • When planning your website, what is one of the key things you should consider
    12·2 answers
  • SHOW ALL YOUR WORK. REMEMBER THAT PROGRAM SEGMENTS ARE TO BE WRITTEN IN JAVA. Assume that the classes listed in the Java Quick R
    9·1 answer
  • What is the output of the C++ codeabove?
    14·1 answer
  • 1. Which of the following is not true about high-level programming language s? (a) Easy to read and write (b) Popular among prog
    12·1 answer
  • Why does this happen
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!