The following are details of the new remove method. All other input/output and p
ID: 3913110 • Letter: T
Question
The following are details of the new remove method. All other input/output and processing of PoD java are handled for you. You will implement a queue in Queue.java. The PoD main file (PoDjava) does not need to be touched. PoDjava will instantiate a queue and read in the batting order. Batters will take a turn at bat. At bat, they will either hit or be out. Once the team has 3 outs, the batting order (and all output) ends. Based on what you create in your queue, we will run through the batting order. Play ball! Directions Implement a queue in Queue.java based on skeleton provided. Examples Sample PoD.java input Alice Bob Carol Dave ve out out out Sample PoD java output Alice is on base! Bob is out! Carol is on base! Dave is out! Eve is on base! Alice is on base! Bob is out! END OF OUTPUTExplanation / Answer
import java.util.LinkedList; public class Queue { LinkedList batters = new LinkedList(); public void add(String s) { batters.addLast(s); } public String remove() { return batters.removeFirst(); } }Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.