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

CSC 312 System modelling using UML

Practice Exercises
1. Explain the three (3) principles upon which Object-oriented design rests
2. Describe the following UML diagrams. i) Class diagram ii) Use case diagram iii)
Sequence diagram
3. What is the relationship between class diagram and sequence diagrams?
4. What is the relationship between class diagram and use case diagram?
5. You have been asked to develop a system that will help with planning large-scale
events and parties such as weddings, graduation celebrations, and birthday parties.
Using an activity diagram, model the process context for such a system that shows the
activities involved in planning a party (booking a venue, organizing invitations, etc.)
and the system elements that might be used at each stage.
6. Develop the design of the weather station to show the interaction between the data
collection subsystem and the instruments that collect weather data. Use sequence
diagrams to show this interaction.
7. Using the UML graphical notation for object classes, design the following object
classes, identifying attributes and operations. Use your own experience to decide on
the attributes and operations that should be associated with these objects.
a) a messaging system on a mobile (cell) phone or tablet
b) a printer for a personal computer
c) a personal music system
d) a bank account
e) a library catalogue

Case Study: A video Rental System


A new video store intends to offer rentals of video tapes and disks to the wider public. The
store management is determined to launch its operations with the support of a computer
video rental system.

The video rental system will initially keep a stock of about a thousand video tapes and five
hundred video disks. The inventory has already been ordered from the suppliers who are
generally able to supply tapes and disks within one week. Each movie medium has a unique
identification number. Typically, several movies are ordered by sending a single order to a
supplier. All video tapes and disks will be bar coded so that a scanning machine integrated
with the system can support the rentals and returns using the computer system. The
minimum information about the video tapes and disks is title, producer, cost, and date
received but it should be extendable in future to include additional details. A video tape/disk
stored in the system should be allowed to record more than one copy using different copy
numbers. The system be able to issue a new membership card to a new customer. The
customer membership cards will also be bar coded. Provided the customer has a non-
delinquent account, the tape is rented out once payment has been received.
A customer wishing to rent a video tape/disk needs to pick it from the store’s shelves and
take it to a clerk, or get it from a clerk if it has been previously reserved for the customer. The
clerk will use the video rental system to scan the video/disk and the membership card for the
rental. Any delinquent or overdue details will be brought up by the system for the clerk to
query the customer about. If the customer does not have a delinquent rating, the customer
can hire up to a maximum of eight video tapes and disks. However, if the rating of the
customer is “unreliable”, a deposit of one rental for each tape/disk is requested. For each
video barcode entered, the system completes the rental detail line on the screen with today’s
date, due return date, movie cod, movie title, and rental price. When barcodes for all the
video tapes and disks to be rented have been entered, the system computes the total fee of
the rental and displays on the screen. When the fee appears on the screen, the clerk tells the
customer the total amount to be paid for this rental. Customers are required to pay the rental
charges when video tapes and disks are checked out. They can pay the total amount by cash,
credit card or electronic transfer. If the customer pays by credit card, the credit card number,
type, name of the card company and expiration date will be recorded in the system for later
access. The rental request will be rejected if the payment is invalid or the rating of the
customer is “unreliable”.

Each rental will be recorded in the system and a separate rental record is created for each
video tape/disk hired. A rental record stores (under the customer’s account) the check-out
and due-in dates together with the identification of the clerk who authorized the video/disk
in this rental. Once the amount payable is received, the clerk enters the money amount into
the rental system and a receipt is produced by the system. The stock is then updated by the
system and the video tapes and disks are handed out to the customer together with the rental
receipt by the clerk. Each rental record is later updated to indicate if the video tape/disk has
been returned and the final payment (or reimbursement) has been made. The name and staff
number of the clerk who authorizes the rental are also recorded in the system. Details about
the customer and his/her rental details are kept for a year to enable the customer’s rating to
be easily determined. Old rental details are kept for auditing purposes for the year.

When a video tape/disk is returned late (or it cannot be returned for whatever reason), a
payment for late return is taken from the customer’s account or directly from the customer.
The system should check overdue video tapes and disks each day. If a tape or disk is not
returned within two days, the system will produce and overdue notice to be mailed to the
customer. A second notice will be produced and sent to the customer if the tape or disk is not
returned after another two days. Once two overdue notices on a single tape/disk have been
sent, the customer is noted to be delinquent and the next rental is subject to management
removing the delinquent rating.
Existing customers will be allowed by the system to place reservations on videos to be
collected at a specific date. Reservations are accepted for a movie if it is on order of if all
copies of a particular movie are rented out. Reservations are also accepted for movies that
are neither in store nor on order, but a customer is then asked for a deposit of one rental
period. The system must have a flexible search engine to answer to answer customer
enquiries, including enquiries about movies the video store does not stock (but may order on
request). A reservation may be cancelled due to lack of response from a customer, more
precisely one week from the date the customer was contacted that the movie was available
for rental. If a deposit has been paid it is then credited to the customer’s account. When a
tape or disk is returned by the customer o r supplied by the supplier, reservations are firs
satisfied. This involves contacting the customer who made the reservation. In order to ensure
that reservations are properly handled, both the “reserved movie has arrived” contact the
customer and the subsequent rental to the customer are related back to the reservation.
These steps ensure that reservations are properly carried through using the system.

The video store keeps in stock and extensive library of current and popular movie titles using
the computer system. A particular movie may be held on video tapes or disks. Video tapes
are in either “Beta” or “VNS” format. Video disks are in “DVD” format. Each movie has a
particular rental period (expressed in days), with a rental charge for that period. The video
rental system must be able to answer immediately any enquiries about a movie’s stock
availability and how many tapes/disks are available for rental (i.e. the current situation of
each tape and disk must be known and recorded in the system).

The rental charge differs depending on the video medium: tape or disk (but it is the same for
the two categories of the tape: Beta and VHS). Although the DVD disk is the only format of
video disks currently kept in the store, the video store wants the system to extend easily to
other disk formats in the future. The employees of the video store tend to remember the
codes of the most popular movies. They frequently use a movie code, instead of movie title,
to identify the movie. This is a useful practice because the same movie title may have more
than one release by different directors. The computer video rental system should provide
such a code quickly for the employee who only remembers the title but not the code.
The video rental system needs to keep useful information about suppliers and customers, i.e.
their names, addresses, phone numbers, etc. Each order sent to a supplier consist of a set of
lines each of which shows the title of an ordered movie, its tape/disk formats, the quantity
ordered, expected delivery date, purchase price, and applicable discounts.

8. a. Using the case study information supplied above, draw a class diagram for the system
that contains
i). Classes. [At least 10 classes expected]
ii). Attributes of the classes with visibility and data types and possible methods.
iii). Relationships (associations, aggregations, generalizations) between classes.
b. Briefly discuss the relationship between the class diagram and the use case diagram in
object-oriented programming
9. a. Using the case study information supplied above, draw a use case diagram for the
system that contains
i). Use cases [At least 10 use cases expected]
ii). Actors
iii). Relationships between the actors and the use cases, and the relationships
between the use cases.
b. Briefly discuss the relationship between the class diagram and the use case diagram in
object-oriented programming.

You might also like