Write a java class

Assignment Help JAVA Programming
Reference no: EM131990

Problem 1. The Queue ADT

A queue is a fundamental abstract data type. It is an ordered collection of items in which the removal of items is restricted to the FIFO ( rst in rst out) principle. That is, the rst item added to the queue will be the rst one removed, the second added will be the second removed, etc. The Queue ADT can be described as follows:

When you are standing in line waiting for a bank teller, you are in a queue of people. The rst in the line is the rst to be served (the rst to be removed from the queue). The next in line is the second to be served (or removed from the queue). Using this understanding of a queue, we will say that items added to a queue are added to the back of the queue (i.e., you go to the back of the line when you add yourself to the line). The word for adding an element to a queue is enqueue. When we remove an item for a queue, we remove it from the front of the queue (i.e., if you are next to be served in the line, you are at the front of the line). The word for removing an item from a queue is dequeue.

Note that front and back are just words that we use to understand what a queue is. It does not necessarily indicate how the data in the queue should be stored (or how the methods are implemented).

Write a Java class called PQueue that extends the provided abstract QueueADT class. Your class will implement a queue of people (objects of the provided Person class). Do not change the Person class or the QueueADT class.

Problem 2:

Draw a picture that reects, in some way, what you did on the long weekend and how it relates to COMP1006/1406 (or computer science in general). You can submit a hardcopy of your picture or you can electronically submit it in a pdf.

You will not be graded by artistic quality. The majority of the mark will simply be for submitting something. To receive full marks the drawing should have some relation to computer science.

Reference no: EM131990

Questions Cloud

Estimate the linear demand equation : Estimate the linear demand equation
Write a program using binary search approach : Write a program using binary search approach
Write a java class : Write a Java class called PQueue that extends the provided abstract QueueADT class.
Data structures and algorithm design : Data Structures and Algorithm Design
Who will be the main actors responsible for innovation : Who will be the main actors responsible for innovation?
Plan for the optimal use of the promotional mix elements : Promotional strategy is a plan for the optimal use of the promotional mix elements.
Impact on the strategies of foreign firms : How are they likely to impact on the strategies of foreign firms

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Develop a reliable transfer protocol over udp

Develop a reliable transfer protocol over UDP. Focus on a Stop- and-Wait protocol.

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Mvc pattern and servlet

When you use the MVC pattern, the controller directs the flow of control to

  Print the contents of the array

Prepare a second loop that prints the contents of the array

  Implementation of encryption and steganography in java

This is a project report showing the essential details and coding structures related with the implementation of encryption techniques and steganography in JAVA.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Java program simulate a network

Java program simulate a network

  Design a course registration system

Create an application which represents a simplified course registration system using ArrayLists and HashMaps.

  Implement the lexical and syntactic analysis

Implement the lexical and syntactic analysis of Minifun programming language.

  Evaluate the rtas resource requirements

Design and implement a set of classes and interfaces and use them to evaluate the RTA's resource requirements.

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