Question: Write a program that coordinates furnished apartments booking using single linked list. Your work should include three classes: ApNode.java, ApLinkedList.java, and the class with main

Write a program that coordinates furnished apartments booking using single linked list. Your work should include three classes: ApNode.java, ApLinkedList.java, and the class with main method named: hw1_exercise1.java. The main method prints a menu with the following commands: Book an apartment, Cancel an apartments booking, Check apartments booking, Display all bookings, Exit. The menu keeps running until the Exit option is entered by the user. One ApLinkedList list is declared in the main method to perform the above operations. The ApNode class should have information about the name of the renter of the apartment (String) and the number of rooms in the apartment (int between 1 to 3), along with the linking reference to ApNoed named next. Your class should include the constructors and accessor methods needed to set and get the given information. The ApLinkedList class should include the methods the perform the four operations of the menu (add new renter, cancel a renter given his/her name, check if a renter exists in the list, and display details of each renter (Name: , No. of Rooms: ) in the list.

in java

sample input/output

Write a program that coordinates furnished apartments booking using single linked list.Your work should include three classes: ApNode.java, ApLinkedList.java, and the class with

run: Apartment Booking (1) Book an apartment. (2) Cancel apartment's booking. (3) Check apartment's booking. (4) Display all bookings. (5) Exit. Enter your option:1 Book an Apartment: Enter renter name: Ahmed Enter number of rooms: 2 Booking an Apartment processed successfully. Apartment Booking (1) Book an apartment. (2) Cancel apartment's booking. (3) Check apartment's booking. (4) Display all bookings. (5) Exit. Enter your option:3 Check booking Enter renter name: Ahmed The renter Ahmed has booked an apartment with 2 rooms. Checking renter processed successfully Enter your option:3 **** Check booking Enter renter name: Ahmed The renter Ahmed has booked an apartment with 2 rooms. Checking renter processed successfully *** Apartment Booking (1) Book an apartment. (2) Cancel apartment's booking. (3) Check apartment's booking. (4) Display all bookings. (5) Exit. Enter your option: 4 All Apartments' Bookings: Renter Rooms Mohammed Saif 3 Ahmed Ali N

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!