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
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started