0% found this document useful (0 votes)
3 views

Applied programming Assignment 1

The document outlines the design and implementation requirements for a simple Hotel Booking System in Java, detailing the necessary classes such as Room, Customer, Booking, and Hotel. It specifies functionalities like adding rooms, booking, checking availability, and handling cancellations, while emphasizing object-oriented design principles like encapsulation, inheritance, and polymorphism. Additional requirements include proper use of arrays, constructors, and Java data types, along with submission guidelines and grading criteria for the assignment due by September 28th, 11:59 PM.

Uploaded by

Abdul Rahman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Applied programming Assignment 1

The document outlines the design and implementation requirements for a simple Hotel Booking System in Java, detailing the necessary classes such as Room, Customer, Booking, and Hotel. It specifies functionalities like adding rooms, booking, checking availability, and handling cancellations, while emphasizing object-oriented design principles like encapsulation, inheritance, and polymorphism. Additional requirements include proper use of arrays, constructors, and Java data types, along with submission guidelines and grading criteria for the assignment due by September 28th, 11:59 PM.

Uploaded by

Abdul Rahman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Hotel booking system

Design and implement a simple Hotel Booking System in Java. This system will manage
hotel rooms, customer reservations, and handle bookings for different types of rooms.

Requirements
Classes to be implemented
1. Room
a. This class represents hotel rooms with the following attributes:
i. roomNumber (String)
ii. roomType (String: "Standard", "Deluxe", "Suite")
iii. isBooked (boolean)
b. Constructor: Create a constructor to initialize the roomNumber,
roomType, and set isBooked to false by default.
2. Customer
a. Represents a customer making a booking with attributes:
i. customerID (String, unique)
ii. name (String)
iii. contactNumber (String)
iv. bookedRooms (Array of Room objects, limit to 3 rooms per
customer)
b. Constructor: Create a constructor to initialize customerID, name, and
contactNumber. The array for booked Rooms should be initialized as an
empty array.
3. Booking
a. Represents a room booking with attributes:
i. bookingID (String, unique)
ii. customer (Customer)
iii. rooms (Array of Room objects)
iv. bookingDate (Date)
b. Constructor: Create a constructor to initialize bookingID, customer, and
rooms. The booking date should be set to the current date automatically.
4. Hotel:
a. Represents the hotel with attributes:
i. name (String)
ii. rooms (Array of Room objects)
iii. customers (Array of Customer objects)
iv. Bookings (Array of Booking objects)
b. Constructor: Create a constructor to initialize name, rooms, and
customers. Use arrays to manage bookings, room availability and
customers.

Functionalities
1. Add Rooms:
a. Implement a method to add rooms to the hotel. The hotel should have 3
different types of rooms: "Standard", "Deluxe", and "Suite". Use an array
to store rooms.
b. Overload the addRoom method:
i. First version accepts a Room object.
ii. Second version accepts individual room details (roomNumber and
roomType) and then creates a new Room object internally.
2. Book a Room:
a. Implement a method to allow a Customer to book a room. The customer
should be able to book up to 3 rooms at max, stored in an array.
b. Override the method for VIP customers (inherit from Customer). VIP
customers can book up to 5 rooms.
c. Mark the room as isBooked = true once it is booked.
3. Check Availability (bonus question):
a. Implement a method to check room availability. The system should
display the available rooms (i.e., rooms that are not booked).
4. Handle cancellations (bonus question)
a. Implement a method to cancel a booking.
5. Display Bookings (bonus question)
a. Implement a method to display all the rooms booked by a particular
customer.

Object-Oriented design requirements


1. Encapsulation:
a. Mark the fields private that should not be public.
2. Inheritance:
a. Create a subclass of Customer called VIPCustomer.
b. VIP customers should have additional privilege to book up to 5 rooms,
instead of 3.
3. Polymorphism:
a. Override the room booking method in VIPCustomer.
b. Demonstrate method overriding in VIPCustomer and show how you can
treat both regular Customer and VIPCustomer objects polymorphically,
allowing different behaviors for the same method (bookRoom()).

Additional requirements
1. Arrays:
a. Use arrays to store rooms, customers, and bookings.
2. Java Constructors:
a. Use constructors to properly initialize objects with required fields.
3. Java Variables & Data Types
a. Ensure that your code demonstrates good use of Java variables, data
types (e.g., String, boolean, int), and constants (if applicable).

Submission guidelines
1. Deliverables
a. Source code (.java files).
b. A text or markdown file (README.md) describing:
i. Your approach to solving the problem.
ii. Any additional features you implemented.
iii. Instructions on how to run the program.
iv. Any additional information you want me to be aware of
2. Grading Criteria:
a. Correctness: The program should work according to the requirements.
b. Design: The use of OOP principles (encapsulation, inheritance,
abstraction, polymorphism), method overloading, method overriding,
constructors and arrays.
c. Code Quality: Code should be well-structured, clean, and properly
commented.
3. Deadline: Submit your assignment by 28th September, 11:59 PM.
4. You can use any IDE for writing the code.
5. Make sure your code compiles and runs without errors before submission.
6. This is an individual assignment. Discussions are allowed and encouraged,
copying someone else’s work is not.
7. Stay away from AI tools while attempting the assignment.
8. Submission portal will be announced later.

You might also like