Write and test a class for a queue of objects

Assignment Help Programming Languages
Reference no: EM131697243

Assignment

Your assignment is to create and test a class for a queue of objects. You may use any object class of your choice as the data for the queue. The instances of the class should have at least one field that distinguishes each instance from other instances of the class (key property, also called a key field).

You should complete the software to implement and test your queue and submit the software along with a project report.

Your queue class should maintain a head pointer to the first element in the queue, a tail pointer to the last element in the queue, and the size of the queue as queue properties.

We will add elements to the tail of the queue and remove elements from the head of the queue. The head pointer points to the spot from which elements are deleted from the queue, and the tail pointer points to the end of the queue where elements are added to the queue.
Note that elements move though the queue in the opposite direction of the pointers from one element to the next. Head points to the first element in the queue. Head.next points to the element that will become the head when the head is removed (de-queue method) - the pointers point back in the queue.

You should have methods to:

• instantiate a null queue
• enqueue - add an element to the queue
• dequeue - remove an element from the queue
• size - return the size of the queue
• a boolean isEmpty method

You will need to create a class of nodes for the data in the queue, which we call a queueElement.

Each queueElement should have data and a pointer to the next queueElement.

We need:

• A null constructor (default)
• An initializing constructor (instantiates a queueElement from a data element)

and methods to :

• set the data in a queue element
• return the data in a queue element
• set the pointer to the next element
• return the pointer to the next element

This assignment requires four classes - Queue, QueueElement, the data object class, and a class for your test project. Each class should be a separate file in your NetBeans project, all in the same source directory.

Reference no: EM131697243

Questions Cloud

Determine the variable overhead spending variance : Understanding Relationships, Incomplete Data, Overhead Analysis Lynwood Company produces surge protectors. To help control costs, Lynwood employs a standard.
Maturity on a? comparable-risk bond : The 13?-year ?$1,000 per bonds of Vail Inc. pay 13% percent interest. The? market's required yield to maturity on a? comparable-risk bond is $1,080 percent.
Savings plan that has quarterly payments : Assuming an 4.65% rate of return, compounded quarterly, how much interest would a person earn in a savings plan that has quarterly payments of $155
Calculate the standard fixed overhead rate : During the year, Extrim produced 119,000 units, worked 487,900 direct labor hours, and incurred actual fixed overhead costs of $1.3 million.
Write and test a class for a queue of objects : Your assignment is to write and test a class for a queue of objects. You may use any object class of your choice as the data for the queue.
Replacing the asset in order to avoid recognizinggain : When does Keltron'sreplacement period end for replacing the asset in order to avoid recognizinggain?
Grommit marginal corporate tax rate : Grommit Engineering expects to have net income next year of $20.75 million and free cash flow of $22.15 million. Grommit's marginal corporate tax rate.
Calculate the fixed overhead spending and volume variances : Calculate the fixed overhead spending and volume variances for the Little Rock and Athens plants. What is the most likely cause of the spending variance?
What do you know about the american idiom to suck : Do you suck at something? Do you feel like you suck at writing? What do you know about the American idiom "to suck"?

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd