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

  Write a program that uses the interrupt-driven approach

Period measurement. Use the input-capture channel 0 to measure the period of an unknown signal. The period is known to be shorter than 128 ms. Assume that the E-clock frequency is 24 MHz. Use the number of clock cycles as the unit of the period.

  Calculate the problem and stop after the condition

Use the information below to create a storyboard (which can be a text based description for solving the problems) and a flowchart (using flowchart symbols to illustrate how you would program) to solve each problem. You may use Microsoft Word® for you..

  How do you block a kernel module from loading

How do you block a kernel module from loading? Why would you want to do this?

  The resultant voltage v3 is in the same frequency

Q1.Three impedance are connected in parallel Z1=2+j2, Z2=1+j5, Z3=j6.? Find the equivalent admittance Y where Y=1/Z1+1/Z2+1/Z3.Q2.  V1= 3sin(wt) and V2= 2cos(wt) if V3 = V1 + V2 find the expression of V3 in a sine waveform : V3 = Rsin(wt+α) and verif..

  Write an analytical report describing the impact of breach

The case study focuses on a major IT security breach that occurred in the recent past. Consider yourself as the IT person in charge at TJX. You need to analyze the case and describe the impacts of the breach on TJX.

  How challenging is it to differentiate hostess

How challenging is it to differentiate Hostess' products in today's health conscious marketplace?

  Are you confident about the council''s conclusion

Identify the variables, classify each as categorical or quantitative, and specify units if relevant.

  What is the q complexity of the sum

What is the Q complexity of the sum? Please give a detailed answer so that I may learn from it. Thank you!

  Purpose of the logical network perimeter mechanism

Describe the purpose of the logical network perimeter mechanism and how it establishes a logical boundary. Further, list the components commonly used to create a logical network perimeter. How does this get implemented? Find a company who uses it..

  Large enough organization could split

Discuss this possibility: a large enough organization could split its central office into two locations, along defined lines, so that, under normal conditions, half its operations are conducted at one site and half at the other. Each site could th..

  What is the files size for one user

Additionally we expect each user to send one picture of resolution of 768 * 789 using motion picture color - WHat is the files size for one user/min and What is the file size for all users/min

  Quantity sold and the price for the order

Show the Parts that have no sales as well. Display the PartID, Part Name, Sales Order #, the Quantity sold and the price for the order.

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