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
A(n) ________ is usually a live broadcast of audio or video content. Select one: A. instant message B. webcast C. podcast D. wik
navik [9.2K]

Answer: B webcast

Explanation:

A webcast is a technology that allows the live broadcast of an audio or video event on the Internet. It is also known as Web lecture, virtual meeting, etc. The major advantage is that it gives room for an event to have a larger reach. Webcast participation can be through PC, smart phones, tablets and other devices with quality Internet access.

7 0
3 years ago
Read 2 more answers
John is considering his STEM education choices. He wants to begin working in the technology field as soon as possible.
wariber [46]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

STEM is a curriculum based on the idea of educating students in four specific disciplines — science, technology, engineering,  and mathematics — in an interdisciplinary and applied approach. The students who graduated in STEM-based education getting more paid and jobs than students who did not study the STEM-based education.

As in this question that John is considering his STEM education choices, and he wants to begin working in the technology field as soon as possible. He should pursue bachelor (graduate) degree in technology. Because after, passing out, he can begin working in technology easily.

5 0
3 years ago
Placing graphic material in the appendix is
Mrac [35]
Recommended when the graphics would make a report lengthy or the discussion complic-<span>ated to follow.</span>
8 0
3 years ago
Read 2 more answers
In a shallow copy, ____. the values of two or more pointers are copied into a list two or more pointers of the same type point t
strojnjashka [21]

Answer:

Explanation:

A Shallow copy is a bit-wise (unit of data) copy of an object that can be found/used in an object-oriented programming language code, the copy contains all of the same exact values that exist within the original object. In a shallow copy, two or more pointers of the same type point to the same memory location.

8 0
3 years ago
Read 2 more answers
Create a VBScript script (w3_firstname_lastname.vbs) that takes one parameter (folder name) to do the following 1) List all file
leva [86]

Answer:

Set args = Wscript.Arguments

If (WScript.Arguments.Count <> 1) Then

 Wscript.Echo "Specify the folder name as a command line argument."

Else

   objStartFolder = args.Item(0)

   Set objFSO = CreateObject("Scripting.FileSystemObject")

   if (Not objFSO.FolderExists(objStartFolder)) Then

       Wscript.Echo "Folder "&objStartFolder&" does not exist"

   Else

       Set objFolder = objFSO.GetFolder(objStartFolder)

       Set colFiles = objFolder.Files

       For Each objFile in colFiles

           Wscript.Echo objFile.Name, objFile.Size, objFile.DateCreated

       Next

   End If

End If

Explanation:

Here's some code to get you started.

4 0
3 years ago
Other questions:
  • What are the requirements of a data dictionary ?
    7·2 answers
  • When you make taffy (a pliable candy), you must heat the candy mixture to 270 degrees Fahrenheit. Write a program that will help
    6·1 answer
  • How to do pseudocode and flowchart in BMI ( computer programming ​
    11·1 answer
  • Which of the following was the name of the first generation of cell phone networks?
    14·1 answer
  • Paul is playing a game when his computer shuts down unexpectedly. Paul has noticed recently that his fans are running very loud.
    13·1 answer
  • List at least 5 features that can be used to format a report in word 2013
    6·1 answer
  • Write a summary of five things that you learned about CSS. Do not copy and paste the information. Summarize each point in your o
    5·1 answer
  • Interstate highway numbers Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 of 95) go north/south, an
    8·1 answer
  • Write a program that reads in exam scores and displays the average score and the high score.
    9·1 answer
  • An agile team has which two characteristics? (choose two. ).
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!