Part 1 – Helper Class: Using the skeleton provided, which has a linkedList of reservation objects and a queue of reservation objects. Code all the methods that will affect the linkedList: · public...

1 answer below »


Part 1 – Helper Class:


Using the skeleton provided, which has a linkedList of reservation objects and a queue of reservation objects.


Code all the methods that will affect the linkedList:


·
public int addReservation(Reservation aReservation):
add a reservation object to linkedList in the order of ascending dates



·
public int changeReservation(Reservation oldRes, Reservation newRes):
iterate through the linkedList to find a reservation object in the linkedList, remove it, and then add another reservation object to the linkedList in the order of ascending dates



·
public int deleteReservation(Reservation aReservation):
find a reservation object in the linkedList, remove it



·
public String listAllReserv():
iterate through the reservation linkedList and create a String of all reservation objects in the order of ascending dates.



Code all the methods that will affect the queue:


·
public int addAWalkInQueue(Reservation aReservation):
add a reservation object to the queue in FIFO order



·
public String listAllWalkIns():
iterate through the reservation queue and create a String of all reservation objects in the queue in FIFO order



·
public Reservation deleteAWalkIn():
iterate through the reservation queue and remove the first reservation object in the queue







Part 2 –RestaurantSystem Class:


Using the skeleton provided, display a menu of options for the user:


1. Make a Reservation
2. Change a Reservation
3. Cancel a Reservation
4. List all of the Reservations
5. Seat a Reservation
6. Add a Walk-In
7. List all of the Walk-Ins
8. Seat a Walk-In
9. Exit



Keep looping and displaying the menu, processing the user’s request. Each menu option calls a corresponding public void method(), which in turn interacts with the user by asking for data that is needed to then create a Reservation object(s) and pass it to the corresponding method in the Helper class, to add, change, or remove either the linkedList of reservation objects or add and remove to the queue of walk-in reservation objects.


Each of the following methods are called depending on the menu option that was selected:


1. public void addReservation()


2. public void changeReservation()


3. public void cancelReservation()


4. public void listAllReservations()


5. public void seatAReservation()


6. public void addAWalkIn()


7. public void listAllWalkIns()


8. public Reservation seatAWalkIn()



The skeleton is provided using the console to display (sout) information, and the keyboard to retrieve information from the user.


Extra Credit will be awarded if the driver class, RestaurantSystem.java, is converted into a GUI that contains a JFrame, with JPanel(s), text fields, labels, and buttons for each of the actions listed in #1 – 8. Create a JPanel for all the buttons that represent


I also have the skeleton
Answered Same DayNov 20, 2021

Answer To: Part 1 – Helper Class: Using the skeleton provided, which has a linkedList of reservation objects...

Shweta answered on Nov 22 2021
154 Votes
Solution_72294/RestaurantSystem/build/built-jar.properties
#Sun, 22 Nov 2020 12:54:12 +0530
C\:\\Users\\Acer\\Documents\\NetBeansProjects\\RestaurantSystem=
Solution_72294/RestaurantSystem/build/classes/restaurantsystem/Helper.class
package restaurantsystem;
public synchronized class Helper {
java.util.LinkedList reservationList;
java.util.Queue walkInQueue;
public void Helper();
public int searchReservation(Reservation);
public int addReservation(Reservation);
public int changeReservation(Reservation, Reservation);
public int deleteReservation(Reservation);
public String listAllReserv();
public int addAWalkInQueue(Reservation);
public String listAllWalkIns();
public Reservation deleteAWalkIn();
}
Solution_72294/RestaurantSystem/build/classes/restaurantsystem/Reservation.class
package restaurantsystem;
public synchronized class Reservation implements Comparable {
private String firstName;
private String lastName;
private java.util.Calendar reservationDateTime;
private int sizeOfParty;
public void Reservation();
public void Reservation(String, String, java.util.Calendar, int);
public String getFirstName();
public void setFirstName(String);
public String getLastName();
public void setLastName(String);
public java.
util.Calendar getReservationDateTime();
public void setReservationDateTime(java.util.Calendar);
public int getSizeOfParty();
public void setSizeOfParty(int);
public String toString();
public int compareTo(Reservation);
}
Solution_72294/RestaurantSystem/build/classes/restaurantsystem/RestaurantSystem.class
package restaurantsystem;
public synchronized class RestaurantSystem {
Helper myHelper;
public void RestaurantSystem();
public static void main(String[]);
public int displayMenu();
public int getPartySize(java.util.Scanner);
public java.util.Date getDate(java.util.Scanner);
public Reservation createReservationObject();
public void addReservation();
public void changeReservation();
public void cancelReservation();
public void listAllReservations();
public void seatAReservation();
public void addAWalkIn();
public void listAllWalkIns();
public void seatAWalkIn();
}
Solution_72294/RestaurantSystem/build.xml

Builds, tests, and runs the project RestaurantSystem.


Solution_72294/RestaurantSystem/dist/README.TXT
========================
BUILD OUTPUT DESCRIPTION
========================
When you build an Java application project that has a main class, the IDE
automatically copies all of the JAR
files on the projects classpath to your projects dist/lib folder. The IDE
also adds each of the JAR files to the Class-Path element in the application
JAR files manifest file (MANIFEST.MF).
To run the project from the command line, go to the dist folder and
type the following:
java -jar "RestaurantSystem.jar"
To distribute this project, zip up the dist folder (including the lib folder)
and distribute the ZIP file.
Notes:
* If two JAR files on the project classpath have the same name, only the first
JAR file is copied to the lib folder.
* Only JAR files are copied to the lib folder.
If the classpath contains other types of files or folders, these files (folders)
are not copied.
* If a library on the projects classpath also has a Class-Path element
specified in the manifest,the content of the Class-Path element has to be on
the projects runtime path.
* To set a main class in a standard Java project, right-click the project node
in the Projects window and choose Properties. Then click Run and enter the
class name in the Main Class field. Alternatively, you can manually type the
class name in the manifest Main-Class element.
Solution_72294/RestaurantSystem/dist/RestaurantSystem.jar
META-INF/MANIFEST.MF
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.9.7
Created-By: 1.8.0_111-b14 (Oracle Corporation)
Class-Path:
X-COMMENT: Main-Class will be added automatically by build
Main-Class: restaurantsystem.RestaurantSystem
restaurantsystem/Helper.class
package restaurantsystem;
public synchronized class Helper {
java.util.LinkedList reservationList;
java.util.Queue walkInQueue;
public void Helper();
public int searchReservation(Reservation);
public int addReservation(Reservation);
public int changeReservation(Reservation, Reservation);
public int deleteReservation(Reservation);
public String listAllReserv();
public int addAWalkInQueue(Reservation);
public String listAllWalkIns();
public Reservation deleteAWalkIn();
}
restaurantsystem/Reservation.class
package restaurantsystem;
public synchronized class Reservation implements Comparable {
private String firstName;
private String lastName;
private java.util.Calendar reservationDateTime;
private int sizeOfParty;
public void Reservation();
public void Reservation(String, String, java.util.Calendar, int);
public String getFirstName();
public void setFirstName(String);
public String getLastName();
public void setLastName(String);
public java.util.Calendar getReservationDateTime();
public void setReservationDateTime(java.util.Calendar);
public int getSizeOfParty();
public void setSizeOfParty(int);
public String toString();
public int compareTo(Reservation);
}
restaurantsystem/RestaurantSystem.class
package restaurantsystem;
public synchronized class RestaurantSystem {
Helper myHelper;
public void RestaurantSystem();
public static void main(String[]);
public int displayMenu();
public int getPartySize(java.util.Scanner);
public java.util.Date getDate(java.util.Scanner);
public Reservation createReservationObject();
public void addReservation();
public void changeReservation();
public void cancelReservation();
public void listAllReservations();
public void seatAReservation();
public void addAWalkIn();
public void listAllWalkIns();
public void seatAWalkIn();
}
Solution_72294/RestaurantSystem/manifest.mf
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build
Solution_72294/RestaurantSystem/nbproject/build-impl.xml















































































































































































































Must set src.dir
Must set test.src.dir
Must set build.dir
Must set dist.dir
Must set build.classes.dir
Must set dist.javadoc.dir
Must set build.test.classes.dir
Must set build.test.results.dir
Must set build.classes.excludes
Must set dist.jar




































































































Must set javac.includes































































































































...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here