The Eratosthenes sieve is a simple algorithm to find all prime numbers less than a given number. It proceeds as follow: make a collection of numbers between 2 and the given number (let's call it allNumbers) make an empty collection that will receive a

education

Description

The Eratosthenes sieve is a simple algorithm to find all prime numbers less than a given number. It proceeds as follow: make a collection of numbers between 2 and the given number (let's call it allNumbers) make an empty collection that will receive all the prime numbers (let's call it allPrimes) repeat until allNumbers is empty the following steps remove the first element of allNumbers, call it prime, and put it in allPrimes remove all multiple of prime from allNumbers print all numbers from allPrimes Implement this algorithm choosing appropriately what collections from the java.util package can be best for allNumbers and allPrimes. Explain your choices in your documentation. The deliverables are one Java class, allowing to run the sieve by passing the maximum number on the command line, the design document (no more than one page) explaining the choice of data structures, and a test document explaining how you check the correctness of your program. Grading rubrics: Design document: 20% clear explanation of the implementation choices (10% for each collection) Test document: 20% include 2 examples of runs with an explanation about how you checked the correctness of the results independently of the program. Do not include tests for incorrect input. Implementation: 20% (correct completion grade) Code structure: 20%.Use of proper Java constructs Presentation: 20% (see presentation rubric in week 1 assignment).


Related Questions in education category


Disclaimer
The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.