Scenario/Summary
This week, you will be writing 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 imagination. Remember that if the number N is even, it cannot be a prime number. You can write your program to simply see whether 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 also might consider that the fastest way to find out if N is a multiple of p is to divide N by p and see if the result is a whole number.
You may use any language you prefer, but it is recommended you use C# or C++ because these are the languages supported by DeVry in the programming courses you have taken.
Don’t forget to submit your lab.
Deliverables
Your submission will consist of the following items.
Write a description and step-by-step explanation of your algorithm. You may include a flowchart.
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.
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).
Include your largest number tested and the estimated execution time.
Describe any improvements you made to the original program that resulted in faster execution, if you have any.
Submit your projection of how the execution time of your program will grow as the tested number N becomes larger.
* You can also use 2CO option if you want to purchase through Credit Cards/Paypal but make sure you put the correct billing information otherwise you wont be able to receive any download link.
* Your paypal has to be pre-loaded in order to complete the purchase or otherwise please discuss it with us at [email protected].
* As soon as the payment is received, download link of the solution will automatically be sent to the address used in selected payment method.
* Please check your junk mails as the download link email might go there and please be patient for the download link email. Sometimes, due to server congestion, you may receive download link with a delay.
* All the contents are compressed in one zip folder.
* In case if you get stuck at any point during the payment process, please immediately contact us at [email protected] and we will fix it with you.
* We try our best to reach back to you on immediate basis. However, please wait for atleast 8 hours for a response from our side. Afterall, we are humans.
* Comments/Feedbacks are truely welcomed and there might be some incentives for you for the next lab/quiz/assignment.
* In case of any query, please donot hesitate to contact us at [email protected].
* MOST IMPORTANT Please use the tutorials as a guide and they need NOT to be used for any submission. Just take help from the material.
******************************************** Good Luck ***************************************************
Any personal information received will only be used to fill your order. We will not sell or redistribute your information to anyone.
We will try our best to resolve the issue and if still persists we can discuss for a refund in case its required.