Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92315741
  • Price:- $30

Priced at Now at $30, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Explain why some organizations may not place enough

Explain why some organizations may not place enough importance on disaster recovery. What might happen to these organizations in the event of an actual disaster?

Questionargentina has 10000 hours of labormonth- producing

Question:Argentina has 10,000 hours of labor/month: - producing 1 lb. coffee requires 2 hours; - producing 1 bottle wine requires 4 hours. Brazil also has 10,000 hours of labor/month: - producing 1 lb. coffee requires 1 ...

Identify and evaluate at least three considerations that

Identify and evaluate at least three considerations that one must plan for when designing a database. Suggest at least two types of databases that would be useful for small businesses, two types for regional level organi ...

We have a scheme program belowdefine lst i think you like

We have a Scheme program below: (define lst '(I (think you) like me)) (set! lst (cdr lst)) (set-car! lst '(thinks you)) (set! lst (cons 'he (cons 'also lst))) (a) For each execution step of the above program, draw the me ...

Tablet recommendationpreparation imagine the following

Tablet Recommendation: Preparation Imagine the following scenario: A hospital has hired you as a consultant to recommend a tablet for their employees to use, with these parameters: The hospital provides wifi access to th ...

Koh aq cuno32 aq precipitatekbr aq srno32 aq no

KOH (aq)+ Cu(NO3)2 (aq) = precipitate KBr (aq) + Sr(NO3)2 (aq) = no precipitate a) What are the possible products when solutions of KOH and Cu(NO3)2 are mixed? b) What are the possible products when solutions of KBr and ...

Explain the difference between penetration tests and

Explain the difference between penetration tests and security tests. Emphasize that this book will explain things from a security testing perspective.

Suppose you have two sorted arrays of n integers x01n and

Suppose you have two sorted arrays of n integers: X0[1..n] and X1[1..n]. Devise and analyze an efficient algorithm for finding the median of all numbers in arrays X0 and X1. Now, suppose you have not two, but three such ...

The rooted fibonacci trees tn are defined recursively in

The rooted Fibonacci trees T n are defined recursively in the following way. T 1 and T 2 are both the rooted tree consisting of a single vertex, and for n = 3, 4, ...., the rooted tree T n is constructed from a root with ...

Select one of the discussion topics and respond begin your

Select one of the discussion topics and respond. Begin your response by indicating which question you chose. Discussion topics: Section 4.1 Would you prefer a class in which 10 percent get A's and everyone competes for g ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As