Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

FAKULTI KOMPUTERAN

MATAPELAJARAN: OBJECT-ORIENTED PROGRAMMING


KOD: BCS2143
PENILAIAN: Lab exercise
BIL: 1 MASA: 2 Hours

TOPIC CHAPTER 2. Use Case Diagram & Use Case Description


TIME 2 hours
MARK
INSTRUCTION 1. This work should be done individually.
TASK Read the following case study and answer the following questions

Case Study 1

SEGAR INDAH Enterprise (SIE) is a small homestay firm that has several
homestay houses located in Pekan Pahang. During a school holiday, SIE receives
many requests for homestay reservations. The business has grown rapidly over the
past year, and the owner wants to install an Online Application System based on a
Java program for managing the homestay reservation and the payment record based
on the following manual process flow.

SIE has TWO (2) types of homestay house which are semi-detached and bungalow.
When potential customers call, the staff explains the homestay types to them whose
price type varies according to the model of the homestay. If the customer decides to
book a homestay, the staff records the customer information (name, home address,
email address and phone number) and the information about the homestay reservation
(homestay type, homestay model, reservation date and total number of stay) in the
reservation form. Before completing the form, the staff check the availability of the
homestay model and the reservation date. The homestay is considered reserved if the
customer pays a deposit or makes full payment. The remaining money is collected
(cash or bank transfer) when the customer takes the homestay’s key. If the customer
intends to modify or cancel the reservation, they need to inform the staff to change
the reservation information. The homestay owner would like to use the system for
marketing as well. It should be able to track how customers learned about SIE and to
identify repeat customers, so that SIE can provide special offers to the customer.

1
FAKULTI KOMPUTERAN
MATAPELAJARAN: OBJECT-ORIENTED PROGRAMMING
KOD: BCS2143
PENILAIAN: Lab exercise
BIL: 1 MASA: 2 Hours

Based on the above case study, answer the following questions:

1. Use case diagram. Use StarUML / Ms Visio / Draw IO / Visual Paradigm to draw the
diagram.
2. Based on your answer in Question 1, develop the use case descriptions by using the
template below:

bookHomestay
Use Case Name
If the customer decides to book a homestay
Brief Description
Customer
Actor
The customer has selected a homestay type and chosen the
Pre-condition
check-in and check-out dates.
Basic Flow 1. Enter the type of homestay, checkin date and checkout
date
2. Enter the customer details
3. Check the email address validity
4. Enter the arrival time
5. Click button <next>
6. Enter card details
7. Validate card details
8. Click button <complete booking>
None
Alternate Flow
Exception Flow 1. If the email address is invalid, the system prompts the
customer to enter a valid email address.
2. If the card details are invalid, the system prompts the
customer to enter valid card details.
The homestay reservation is successfully booked.
Post-Condition
None
Constraints

2
FAKULTI KOMPUTERAN
MATAPELAJARAN: OBJECT-ORIENTED PROGRAMMING
KOD: BCS2143
PENILAIAN: Lab exercise
BIL: 1 MASA: 2 Hours

modifyReservation
Use Case Name
Allows the customer to modify an existing homestay
Brief Description
reservation.
Customer
Actor
The customer has an existing reservation that they wish to
Pre-condition
modify.
Basic Flow 1. The customer requests to modify their reservation.
2. The system retrieves the customer's existing reservation
details.
3. The customer specifies the changes they want to make to
the reservation (e.g., change of check-in or check-out
dates, change of homestay type or model).
4. The system checks the availability of the requested
changes.
5. If the requested changes are available and valid, the
system updates the reservation with the new information.
6. The system confirms the modification to the customer.
1a. If the customer requests to modify their reservation but
Alternate Flow
the reservation cannot be found, the system informs the
customer that no matching reservation was found.
4a. If the requested changes are not available (e.g., the
Exception Flow
requested dates are fully booked), the system informs the
customer and prompts them to choose alternative dates or
options.
The customer's reservation is successfully modified with the
Post-Condition
requested changes.
Constraints 1. The modification must be requested within a reasonable
time frame before the original check-in date.
2. Changes are subject to availability and may incur
additional charges depending on the nature of the
modification.

3
FAKULTI KOMPUTERAN
MATAPELAJARAN: OBJECT-ORIENTED PROGRAMMING
KOD: BCS2143
PENILAIAN: Lab exercise
BIL: 1 MASA: 2 Hours

cancelReservation
Use Case Name
Allows the customer to cancel an existing homestay
Brief Description
reservation.
Customer
Actor
The customer has an existing reservation that they wish to
Pre-condition
cancel.
Basic Flow 1. The customer requests to cancel their reservation.
2. The system retrieves the customer's existing reservation
details.
3. The system confirms the cancellation request with the
customer.
4. If applicable, the system calculates any refund amount
based on the cancellation policy.
5. The system updates the reservation status to "cancelled".
6. The system sends a confirmation of the cancellation to
the customer.
None
Alternate Flow
3a. If the customer requests to cancel their reservation but
Exception Flow
the reservation cannot be found, the system informs the
customer that no matching reservation was found.
The customer's reservation is successfully cancelled, and the
Post-Condition
reservation status is updated accordingly.
Constraints 1. The cancellation may be subject to a cancellation fee or
forfeiture of the deposit, depending on the cancellation
policy.
2. Any refund amount is processed according to the terms
and conditions of the reservation and may take some
time to be completed.
3. The cancellation request must be made within the
allowable cancellation period specified in the reservation
policy.

4
FAKULTI KOMPUTERAN
MATAPELAJARAN: OBJECT-ORIENTED PROGRAMMING
KOD: BCS2143
PENILAIAN: Lab exercise
BIL: 1 MASA: 2 Hours

makePayment
Use Case Name
Allows the customer to make a payment for a homestay
Brief Description
reservation.
Customer
Actor
The customer has a confirmed homestay reservation and is
Pre-condition
ready to make a payment.
Basic Flow 1. The customer selects the reservation for which they want
to make a payment.
2. The system retrieves the details of the selected
reservation, including the total amount due.
3. The customer chooses a payment method (e.g.,
credit/debit card, bank transfer, cash).
4. The customer provides the necessary payment
information (e.g., card details, bank account
information).
5. The system processes the payment transaction securely
using the selected payment method.
6. The system updates the reservation status to indicate that
payment has been made.
7. The system generates and sends a payment receipt to the
customer.
None
Alternate Flow
3a. If the selected payment method is invalid or unavailable,
Exception Flow
the system prompts the customer to choose an alternative
payment method.
4a. If the provided payment information is incorrect or
incomplete, the system prompts the customer to correct the
errors.
5a. If the payment transaction fails (e.g., insufficient funds,
technical issues), the system informs the customer and
provides guidance on how to resolve the issue.
7a. If the payment receipt cannot be generated or sent
successfully, the system notifies the customer and provides
alternative means of obtaining the receipt.
The customer's payment for the reservation is successfully
Post-Condition
processed, and the reservation status is updated to reflect the
payment.
Constraints 1. The available payment methods may vary depending on
the system's configuration and the homestay's payment

5
FAKULTI KOMPUTERAN
MATAPELAJARAN: OBJECT-ORIENTED PROGRAMMING
KOD: BCS2143
PENILAIAN: Lab exercise
BIL: 1 MASA: 2 Hours

policies.
2. Payment processing may be subject to transaction fees or
processing times depending on the chosen payment
method.
3. The customer must provide accurate and valid payment
information to complete the transaction successfully.
4. The payment receipt serves as proof of payment and
should be retained by the customer for reference
purposes.

6
FAKULTI KOMPUTERAN
MATAPELAJARAN: OBJECT-ORIENTED PROGRAMMING
KOD: BCS2143
PENILAIAN: Lab exercise
BIL: 1 MASA: 2 Hours

3. Draw an activity diagram.

7
FAKULTI KOMPUTERAN
MATAPELAJARAN: OBJECT-ORIENTED PROGRAMMING
KOD: BCS2143
PENILAIAN: Lab exercise
BIL: 1 MASA: 2 Hours

Case Study 2

Open Course Registration is one of the application system used by UMPSA students to
register the course (subject) on each semester depending on the academic calendar. The
process starts when Faculty create the subject offered based on the course catalogue.
Once a subject is offered, students are allowed to register for subject. Each subject is
allocating timeslot, pre-requisite, Lecturer and Classroom. The classroom is either
lecture hall, lecture room or computer laboratory. Based on the timeslot, each of
student, lecture, and classroom will have their own timetable. Thus, the subject
registered must not ‘clash’. Then, registration of subject will consider the pre-requisite
subject by referring to the Academic Management Record System.

1. Identify the following items


a. Actors
b. Use cases
2. Draw a use case diagram
3. Draw an activity diagram
4. Create a use case description for each use case that has been identified.

[END OF LAB 2]

You might also like