Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

CI TE

2.0
U nle a shing Possibilit ie s

Karl Vincent V. Salvacion


Cean Darius Katigbak
GT2D: Machine Problem #2 (GT2D): Reservation System with Abstraction and Encapsulation
and Inheritance
C2A - OOprog

REQUIREMENTS:

1. Create the following for the DLSL Reservation System that is described below.
a. Use Case Diagram
b. Class Diagram
c. Program with Implementation of Abstraction, Encapsulation, and Inheritance

DLSL RESERVATION SYSTEM

The clients can book a reservation through via online or through a phone call where in details of
the reservation are given such as personal information, date and time of the reservation,
facilities to be reserved, number of guests, and others. The reservation fee should be paid 24
hours after the transaction. All the reservation transactions are being monitored by the front
desk officer. For online reservations, he verifies the payment checking the status of the
reservation. Once verified, he updates the record and confirms the transaction. If the booking
was made through a phone call, the front desk officer waits for the bank confirmation before
updating the status of the reservation. The front desk officer then sends the details of the
reservation to the clients. The clients can cancel the reservation by accomplishing the Cancel
Reservation form that is accessible only in DLSL’s website. To approve the cancellation request,
the front desk officer needs the authorization of the hotel manager. The hotel manager is also in
charge in monitoring all matters related to reservation transactions. During check in, the
receptionist attends to the needs of the clients as well as during check out.

2. Save the program as gt2d-<section>-<lastname>.cpp

3. The following data are needed for the reservation transaction:


a. Full name of the Customer, Address, Contact #, Email Address
b. Date of Reservation (Inclusive Date)
c. Number of Guests
d. Type of Rooms (Single, Double, Twin, King, Suite)
Single – Php1, 500.00
Double – Php2, 000.00 per night (Max of 2 pax)
Twin – Php2, 500.00 per night (Max of 2 pax)
CI TE

2.0
U nle a shing Possibilit ie s

King – Php3, 000.00 per night (Max of 4 pax)


Suite – Php4, 000.00 per night (Max of 4 pax)
There is an additional Php500.00 for every extra person for room
accommodation.

e. Payment Type (30% DP, Full Payment)


4. Each transaction is also assigned a transaction number.
5. If the customer wants to cancel or move his reservation, the transaction number is
needed to process the request.
6. Also use constructors and destructors in your program.
7. Apply encapsulation, abstraction and inheritance in your code.
8. Discuss here how you applied the concepts of abstraction, encapsulation, inheritance in
your program. Save this file as gt2D-Doc-<section>-<lastname>.pdf
CI TE

2.0
U nle a shing Possibilit ie s

USE CASE
CI TE

2.0
U nle a shing Possibilit ie s

CLASS DIAGRAM
CI TE

2.0
U nle a shing Possibilit ie s

DISCUSSION OF OOP PRINCIPLES

Application of abstraction in the code

The classes inputValidator, reservationInfo, and roomReservation in this code are abstractions
of the different parts of a room reservation system. Every class concentrates on particular
features while keeping the specifics of its implementation hidden from the users of the class.
Each class abstracts certain functionalities, focusing on specific aspects of the reservation
system. For instance, inputValidator abstracts the validation logic, reservationInfo abstracts
user details, and roomReservation abstracts room-specific information.

Application of encapsulation in the code

Encapsulation occurs in this code when the required data and methods for validating inputs,
providing reserve information, and handling hotel reservations are encapsulated in the classes
inputValidator, reservationInfo, and roomReservation, respectively. The classes encapsulate
the data (fullName, address, contactNum, etc.) and methods (inputInitialInfo(),
inputRoomDetails(), to guarantee data integrity and to give external code a clear interface with
which to work.

Application of inheritance in the code

The code utilizes inheritance through a hierarchical structure of classes: the base class
inputValidator provides methods for input validation, which are inherited by the
reservationInfo class. This class manages user details and incorporates the validation methods
for email, contact number, and reservation date. The roomReservation class further extends
from reservationInfo, handling room-specific information and reservation processes. It
includes methods for gathering room details, managing payments, cancellation, and re-
booking. This inheritance approach ensures code reusability, centralizing validation methods
and promoting an organized structure for the reservation system.

You might also like