Write a description and step-by-step explanation of your


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.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Write a description and step-by-step explanation of your
Reference No:- TGS02302570

Now Priced at $30 (50% Discount)

Recommended (98%)

Rated (4.3/5)