Question: I am currently learning about Queues in Java, and cannot figure out how to complete this lab, any help is greatly appreciated. IntQueue: import java.util.ArrayList;

I am currently learning about Queues in Java, and cannot figure out how to complete this lab, any help is greatly appreciated. I am currently learning about Queues in Java, and cannot figure

IntQueue:

import java.util.ArrayList; import static java.lang.System.*; public class IntQueue { //pick your storage for the queue //you can use the an array or an ArrayList //option 1 private int[] rayOfInts; private int numInts; //option 2 private ArrayList listOfInts; public IntQueue() { } public void add(int item) { } public int remove() { return 0; } public boolean isEmpty() { return false; } public int peek() { return 0; } public String toString() { return ""; } }

IntQueueRunner:

import java.util.ArrayList; import static java.lang.System.*; public class IntQueueRunner { public static void main ( String[] args ) { IntQueue test = new IntQueue(); test.add(5); test.add(7); test.add(9); System.out.println(test); System.out.println(test.isEmpty()); System.out.println(test.remove()); System.out.println(test.peek()); System.out.println(test.remove()); System.out.println(test.remove()); System.out.println(test.isEmpty()); System.out.println(test); } }

A+ Computer Science MAKE A QUEUE Lab Goal: This lab was designed to teach you more about queues. Lab Description : You are to create a queue from scratch using either an array or an ArrayList as the storage for the queue. Starting Class : class IntQueue { //pick your storage for the queue //you can use the an array or an ArrayList Files Needed :: IntQueue.java IntQueueRunner.java 1/option 1 private int[] rayofInts; private int numInts; 1/option 2 private ArrayList listofInts; public IntQueue () { } public void add (int item) { } public int remove() { return 0; } public boolean isEmpty() { return false; } public int peek () { return 0; } public String toString() { return ""; } } Sample Data : see lab Sample Output : [5, 7, 9) false 5 7 7 9 A+ Computer Science - Queue Lab - www.apluscompsci.com true []

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 Databases Questions!