main()
method, take 2 file names as the commandline input.
The first file args[0]
is the input file.
The second file args[1]
is the output file.
main()
method, call a method that reads the data in the file,
and store each each name in a MyQueue
object which is a subclass of class ArrayQueue
by using my QueueInterface.java and ArrayQueue.java files.
main()
method should display a JOptionPane.showOptionDialog()
menu.
The menu has the following choices: "Offer Person", "Poll Person", "Peek Person", "Display List", and "Exit Program".
Here is example code that shows you how to use a JOptionPane.showOptionDialog()
menu:
MenuExample.java.
main()
method should write the names in the queue to the output file.
JOptionPane.showMessageDialog()
method for your output.
JOptionPane.showInputDialog()
method to ask the user for input.
LastnameFirstname19
class, create a second class in your LastnameFirstname19.java
file,
which is the class MyQueue
which is a subclass of class ArrayQueue
.
MyQueue
have an int
parameter
that is used to initialize the superclass ArrayQueue<T>.
Use the method call:super(max);
MyQueue
constructor.
toString()
method should return a String
that displays each name on a different line. See the example output below.
Note that your toString() method must loop through the array of superclass ArrayQueue<T>,
as the main point of this assignment is to learn more about how an array-based queue works.
In other words, you should not use the poll(), peek(), or offer() methods in the toString() method.
Instead, you should loop from the frontIndex to the endIndex of the array in the toString() method.
You need to use modulus (%) to wraparound the circular array.
You should only use the poll(), peek(), or offer() methods in the class LastNameFirstName19.java.
input19.txt output19.txt
Click to validate the HTML code
Click to validate the CSS code