Question: Points: 1 0 0 points Problem Description: 1 . ( 5 0 pts ) Suppose that we want to add a method to a class

Points: 100 points
Problem Description:
1.(50 pts) Suppose that we want to add a method to a class of queues that will
splice two queues together. This method adds to the end of a queue all items that
are in a second queue. The header of the method could be as follows:
public void splice(QueueInterface anotherQueue)
Write this method in such a way that it will work in any class that
implements QueueInterface.
2.(50 pts) After the following statements execute, what are the contents of the deque?
DequeInterface
myDeque = new LinkedDeque<>();
myDeque.addToFront("Jim");
myDeque.addToFront("Jess");
myDeque.addToBack("Jill");
myDeque.addToBack("Jane");
String name = myDeque.removeFront();
myDeque.addToBack(name);
myDeque.addToBack(myDeque.getFront());
myDeque.addToFront(myDeque.removeBack());
myDeque.addToFront(myDeque.getBack());
3. iCollege Submission and Grading
IMPORTANT!!
For part 1, just submit the "Splice()" method in a Word file (,DOCX). Keep it simple! You may provide other methods that are called from within the same class that are required for this method to work. You do not have to include the entire class! The java code should be well formatted by the Java Best Coding Practices and sufficiently commented.
For Part 2, simply provide the final contents of the deque in a list, comma separated, beginning with the front of the queue and listed from left to right. Include Part 2 in the same Word file as Part 1.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!