Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

the third picture is the mark distribution this is the output file, so the output should be exactly like this The purpose of this assignment

image text in transcribed
image text in transcribed
the third picture is the mark distribution
image text in transcribed
this is the output file, so the output should be exactly like this
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
The purpose of this assignment is to practice Class design, Inheritance, Polymorphism, interface as well as the use of ArrayLists. Create a NetBeans project named HW3_Yourld and develop the required classes for the solution. Important: Apply good programming practices: - Provide API documentation comments for your class(s), class constructor(s) and method(s) using the Java standard form for documentation comments discussed in this course. - Use meaningful variables and constant names. - Show your name, university ID and section number as a comment at the start of each class. - Submit to Moodle the compressed file of your project with name "HW3 yourID". A. Problem: The Oman International Exhibition Center(OIEC) intends to organize the booking of its units smoothly. There are two types of units available for booking in OIEC: halls, and pavilions. Both bookings have the following information: - Booking ID, starts with 1 and auto-increments by 1 at each creation of a new booking. - Number of days. - Single day cost. The cost of each booking calculated depending on certain criteria. For halls the cost of a single booking depends on the following equations knowing that rate is a discount rate of a hall entered by the user. Initial cost= Number of days Single day cost Final cost= Initial cost ( rate Initial cost * ) For pavilions the cost of a single booking depends on the Number of days, Single day cost, and on the number of sections required inside the pavilion where the cost of section is 10OR. Initial cost = Number of days * Single day cost Final cost =( Initial cost )+( number of sections 10OR Number of days ) B. What is required? OIEC wants to create a system that manages all booking operations like - adding booking. - cancelling booking. - displaying all bookings sorted depending on their cost. The intended system also calculates the cost of any type of booking, and saves its information in a common ArrayList called bookings. This ArrayList will hold the information of both types of bookings for halls, and pavilions in the OIEC. The system should also display a menu with the following services: - Generate new booking by asking about the unit details to be booked (halls, pavilions), then the system should display the new booking information with the total cost. - Cancel a single booking through its ID. - Display all existing bookings sorted according to their costs using the comparable interface. C. Programming specifications: Your project should include at least five classes: 1. Booking class: To hold general booking information:booking type, booking ID, number of days, and single day cost. It also includes suitable constructor, and accessors/mutators. Beside that it contains two methods: - getCost which calculates Initial cost. - toString which return booking information without cost as a string like (ID, number of days, single day cost) 2. HallBooking class: Inherits all data/methods of the Booking class and override the two methods getCost and toString such that: - getCost method should provide the Final cost of a hall booking. - toString method should produce booking information as a string like (booking type, ID, number of days, single day cost, final cost) 3. PavilionBooking class: Inherits all data/methods of the Booking class and override the two methods getCost and toString such that: - getCost method should provide the final cost of a pavilion booking. - toString method should produce booking information as a string like (booking type ,ID, number of days, single day cost, number of section, final cost) 4. BookingManager class: Performs the actual management of all bookings. It includes an ArrayList called bookings that saves the booking information for both hall and pavilion units. This class may contain the following methods (add booking, cancel booking. display all bookings sorted) or any other set of methods needed to perform the required tasks. 5. MainClass class: This class displays the menu of options and initiate hall bookings/pavilion bookings by calling different methods in the BookingManager class (add booking, cancel booking, display all bookings sorted by cost). Sample run: Two complete sample runs exist in the attached file. Bonus: Add a fourth choice to the menu to check whether a specific booking exists or not by asking about booking ID. \&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\&\& Fi 5 T run: \begin{tabular}{lcccc} BookingType, & ID & numofDays & singleDayCost Booking Cost \\ \hline HHallBooking & 2 & 3 & 4.00 & 11.76 \end{tabular} 1 to make a booking 2 to check a specific booking 3 to cancel a booking 4 to display all bookings 5 to exit Input your choice : 4 \begin{tabular}{lcccc} BookingType, & ID & numofDays & singleDayCost & Booking Cost \\ \hline HHallBooking & 1 & 2 & 3.00 & 5.94 \end{tabular} BookingType,IDnumofDayssingleDayCostBookingCost 1 to make a booking 2 to check a specific booking 3 to cancel a booking 4 to display all bookings 5 to exit Input your choice : 2 input reservationID : 3 Either no bookings or no such booking 1 to make a booking 2 to check a specific booking 3 to cancel a booking 4 to display all bookings 5 to exit Input your choice : 2 input reservationID : 1 \begin{tabular}{lcccc} BookingType, & ID & numofDays & singleDayCost & Booking Cost \\ \hline HHallBooking & 1 & 2 & 3.00 & 5.94 \end{tabular} 1 to make a booking 2 to check a specific booking 3 to cancel a booking 4 to display all bookings 5 to exit Input your choice : 4 1 to make a booking 2 to check a specific booking 3. to cancel a booking 4 to display all bookings 5. to exit Input your cholce : 5 Thank you for using orfC booking systee. Butco successful (total tine: o minvtes it seconds) run: .x+: Helcane to OIEC booking systen 1 to nake a booking 2 to check a specific booking 3 to cancel booking 4 to display all booking 5 to exit Input your chaice : 4 No bookings exist. 1 to make a booking 2 to check a specific booking 3 to cancel a booking 4 to display all bookings 5 to exit Input your cholce: 3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Management Accounting Principles And Applications

Authors: Hugh Coombs, D Ellis Jenkins, David Hobbs

1st Edition

1412908434, 978-1412908436

More Books

Students also viewed these Accounting questions