Java Stacks/Queues

Minimal Submitted FilesYou are required, but not limited, to turn in the following source files:Assignment11.java (You do not need to modify this file.) PrimeComputing.java — to be completed.Requirements to get full credits in DocumentationThe assignment number, your name, StudentID, Lecture number, and a description of each class/file need to be included at the top of each file/class (in this assignment, you might have only one file/class, but in future there will be more than one file.)A description of each method is also needed. Some additional comments inside of methods (especially for a “main” method) to explain code that are hard to follow should be written. You can look at Java programs in the text book to see how comments are added to programs.New Skills to be AppliedIn addition to what has been covered in previous assignments, the use of the following items, discussed in class, will probably be needed:QueuesProgram DescriptionClass Diagram:Assignment #11 will be the construction of a program that takes an integer as a user input and compute all prime numbers up to the integer using queues. Since the Queue is an interface in Java Library and the LinkedList class is one of the classes that implement it, we will be using an object of LinkedList as a Queue. You may only use Queue methods when dealing with your queue.Instruction:Assignment11 classThis class displays a menu for a user. If a user enters “E”, then it asks to enter a positive integer, and it needs to compute all prime numbers up to the integer n. This class is given by the instructor.PrimeComputing classYou need to complete the following method.public PrimeComputing(int enteredNum)This is a constructor of the PrimeComputing class. It needs to initialize the instance variable n to the parameter value of enteredNum. It should also instantiate all queues, originalQueue, primeQueue, backupQueue. For the originalQueue, it needs to enqueue all integers from 2 up to n. For the instance variable lastPrime and primeCount, you can initialize them to a value that will work with code that you will write for other methods of the class.public void computePrimesUpToN()Please see PrimeComputing.java for instructions. There are four parts to complete. 1. You will need to remove the first element from original queue and that will be your next prime number. 2. You need to enqueue this next prime number to the prime number queue. 3. You need to check integers in the original queue and see if any of them can be divided by the next prime number. If so, they need to be removed from the original queue. This process needs to be repeated until you reach a prime number in the original queue that is greater than the square root of the entered number n. You will need to keep track of the last such prime that is used to divide other integers in the original queue. Note that this is not the largest prime number found. 4. After such loop, you will need to move all remaining integers in the original queue to the prime queue. Now the prime queue contains all prime numbers up to n. This will be printed in another method.Requirements:You need to implement this method using an object of the LinkedList class in java.util package to represent a Queue. InputThe following files are the test cases that will be used as input for your program (Right-click and use “Save As”):Test Case #1Test Case #2Test Case #3Test Case #4OutputThe following files are the expected outputs of the corresponding input files from the previous section (Right-click and use “Save As”):Test Case #1Test Case #2Test Case #3Test Case #4Error HandlingYour program is expected to be robust enough to pass all test cases. You may use the Scanner class, but are not limited to it, to handle your user input.
assignment_11.zip

Unformatted Attachment Preview

Don't use plagiarized sources. Get Your Custom Essay on
Java Stacks/Queues
Just from $13/Page
Order Essay


Purchase answer to see full
attachment

GradeAcers
Calculate your paper price
Pages (550 words)
Approximate price: -

Why Work with Us

Top Quality and Well-Researched Papers

We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.

Professional and Experienced Academic Writers

We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.

Free Unlimited Revisions

If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.

Prompt Delivery and 100% Money-Back-Guarantee

All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.

Original & Confidential

We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.

24/7 Customer Support

Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.

Essays

Essay Writing Service

No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.

Admissions

Admission Essays & Business Writing Help

An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.

Reviews

Editing Support

Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.

Reviews

Revision Support

If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.

Order your essay today and save 15% with the discount code DISCOUNT15