Step-by-step explanation of your algorithm

Assignment Help Basic Computer Science
Reference no: EM131507012

Write a program to test for primality of any number N (that is, to test if N is a prime number). Start by writing an algorithm (a set of precise mathematical steps that can be written into a program) to test for primality. For full credit, run the program and use it to test for primality on several numbers. See what the largest number your program can handle is before you find it too slow to yield a result in a reasonable time (if it takes longer than 10 minutes to execute, you are done).

Use your own imagination. Remember that if the number N is even, it cannot be a prime number. You can write your program to simply try if it is a multiple of any numbers smaller than N. Also you can design your program to store all prime numbers less than N that your program has found, then take advantage of the fact that a number only needs to be tested to see if it is a multiple of those prime numbers smaller than N/2. If it is not, then it must be a prime number itself.

You may use any language you prefer, but it is recommended you use C#

Your submission will consist of the following items.

  1. Write a description and step-by-step explanation of your algorithm. You may include a flowchart.
  2. Include the source code written in your chosen language, with ample comments to explain how it relates to the algorithm. You should include an explanation of the software platform you are using, such as the software made available through DeVry.
  3. Submit examples of the results obtained when the program was executed for specific test numbers, including whether or not the number is prime and the approximate execution time (your best estimate will be sufficient).
  4. Include your largest number tested and the estimated execution time.
  5. Describe any improvements you made to the original program that resulted in faster execution, if you have any.
  6. Submit your projection of how the execution time of your program will grow as the tested number N becomes larger.

Reference no: EM131507012

Questions Cloud

Analyze the historical significance of watergate : Analyze the policy of containment. How did the United States enact this policy?Analyze the historical significance of Watergate.
Define five mutually exclusive alternatives for stf : Five mutually exclusive alternatives are being considered for providing a sewage-treatment facility (STF).
Develop companys branding pricing and distribution strategy : Develop the company's branding, pricing, and distribution strategy. Establish whether the company's intention is to be a leader or follower within the industry.
What about cloud backups : What about Cloud Backups? Do you think that the Cloud is secure enough to trust it with our sensitive data? Why or why not? How can we tell?
Step-by-step explanation of your algorithm : Write a description and step-by-step explanation of your algorithm. You may include a flowchart.
Find all customer names who have at least one account : Find all customer names who have at least one account with balance >$100,000. Calculate the sum of all accounts for customer with ID=432.
Pros and cons of the windows firewall : Do a bit of web research on the pros and cons of the Windows Firewall. Then in your discussion post, address the following.
Describe the rising needs for contingency planning : Describe the rising needs for contingency planning at the federal, state, and local level for projected crises scenarios.
Discussion question-working with linux : In this lesson, you were introduced to Linux and its installation process and file systems.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd