The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Write the definitions of the method copyQueue and the copy constructor for the class QueueClass.
Write a program to test these operations.
Â
What to submit:
Â
package queueclass;/*****/public class QueueClass {private int maxQueueSize;private int count;private int queueFront;private int queueRear;private DataElement[] list;//Array of references to the//objects that store queue elements//default constructor//Postcondition: Creates the array of references to the//objects that store queue elements.//maxQueueSize = 100;//count = 0; queueFront = 0;//queueRear = maxQueueSize1;public QueueClass(){maxQueueSize = 100;queueFront = 0;//initialize queueFrontqueueRear = maxQueueSize - 1;//initialize queueRearcount = 0;list = new DataElement[maxQueueSize];//create the array//to implement the queue}//constructor with a parameter//Postcondition: Creates the array of references to the//objects that store queue elements.//maxQueueSize = queueSize;//count = 0; queueFront = 0;//queueRear = maxQueueSize1;//If queueSize <= 0, maxQueueSize = 100;1public QueueClass(int queueSize){if(queueSize <= 0){System.err.println("The size of the array to implement "+ "the queue must be positive.");System.err.println("Creating an array of size 100.");