Queue class:
Using only the Queue class for this assignment. Do not use the built-in STL Queue class that can be found with C++.
Implement a program that computes all the primes up to some integer n. Prompt the user to enter the value of n.
Eratosthenes used a technique known as the Sieve of Eratosthenes.
The algorithm pseudocode is as follows:
1. Create a queue named queueOfIntegers and enqueue it with the consecutive integers 2 through n.
2. Create an empty queue named queueOfPrimes to store primes.
3. Do the following:
4. Get the next prime number, p, by removing the first value in queueOfIntegers.
5. Enqueue the value of p into queueOfPrimes.
6. Create a new queue named newQueue and fill it by doing the following:
7. While queueOfIntegers is not empty, dequeue the front number. If it is not divisible by p, enqueue this number to newQueue (queueOfPrimes.back() is our current prime number).
8. Assign the queueOfIntegers object with the newly created newQueue object.
9. While (queueOfPrimes.back() < sqrt(n))
10. Display the primes, which are all the values in the queueOfPrimes object.
To be submitted:
C++ Program with all necessary source files