Object-oriented analysis and design - questions and answers
1. 2
1) Based on the following case study answer question 1.
Restaurant System
Case Study
The system to be developed is intended to support the day-to-day operations of a restaurant by
improving the processes of making reservations and allocating tables to customers. The restaurant
currently operates a manual booking system using handwritten forms stored in a large folder.
An example of the current manual booking form is given in Figure 1. Each row on this form
corresponds to a particular table in the restaurant. Bookings are entered for a particular table, and
the number of ‘covers’, or diners expected, is recorded for each booking, so that a suitably sized
table can be allocated. The restaurant runs three sittings in an evening, known as the “pre-theatre’,
the ‘dinner’ and the ‘support’ slots, but as the form illustrates, these slots are not strictly adhered to
and bookings can be made for time periods that span more than one slot. Finally, a contact name
and phone number are recorded for each booking.
DINNER BOOKINGS - DATE / /
Table
No.
5.30 p.m. – 7.30 p.m. 7.30 p.m. – 10.00 p.m. 10.00 p.m. – 12.00 Mid Night
Covers Name,
Phone No.
Covers Name,
Phone No.
Covers Name, Phone
No.
1
2
3
Figure 1: A manual booking sheet
Currently there are tables for 2 covers, 4 covers and 6 covers.
Annotations are made to the booking sheet to record various events. When a party arrives and is
seated, the corresponding booking in the booking sheet is crossed out. The party can be seated at a
table other than the booked if it is vacant. This is shown by drawing an arrow from the original
booking to the new table in the booking sheet. If a customer phones to cancel a booking, a note is
made in the booking sheet to indicate that the booking has been cancelled. Other pieces of
information, such as the time by which a table must be vacated, can also be written on the sheet.
Dinner can also be taken at the restaurant without making an advance booking, if a free table is
available. This is known as a ‘walk-in’ and is shown on the sheet as a booking to record table
occupancy, but no record of the customer’s name or telephone number is made.
Once the customers arrive, they are ushered into their respective table/tables, and the dining menu
containing menu items (food, beverages and deserts etc.) is presented by the waiter and menu items
chosen are noted down. Details of these menu items and their respective quantities are indicated in
the invoice items. Customer is presented with the invoice and the relevant payment is made either
by cash or using a credit card. Since a customer can have several bookings or reservations (if
accommodation cannot be provided at a single table, multiple tables have to be allocated) at a
particular time, invoice prepared may cover all such bookings.
2. 3
The need for a computerized system
The restaurant management has identified a number of problems with the manual system. The
system is slow, and the booking forms quickly become difficult to read. This can lead to operational
problems, such as customers being prevented from making a booking because it is not obvious from
the booking sheet that there is in fact a table free. There is no backup system: if a sheet gets
destroyed, the restaurant has no record of what bookings have been made for that evening. Finally,
it is very time-consuming to get even simple management data, such as the rate of table occupancy,
from the existing booking sheets.
For these reasons, among others, the restaurant would like to develop an automated version of the
existing booking sheet. The new system should display the same information as the existing sheet,
and in roughly the same format, to make it easy for restaurant staff to transfer to the new system.
When new bookings are recorded, or changes made to existing bookings, the display should be
immediately updated, so that restaurant staff is always working with the latest information
available.
The system must be able to record significant events that take place when the restaurant is open,
such as the arrival of the customer. Operation of the system will be as far as possible by direct
manipulation of the data presented on the screen. For example, it should be possible to change the
time of a booking, or the table it is allocated to.
System needs to store information about dining menu, menu items and invoice details to support
some of the functionalities needed to be supported.
System should also support the following :
• On line Reservation,
• Allow cash or credit card payments.
If a customer uses two or more tables with more than 8 covers, 7% discount is given.
This will be applied for any kind of payment. Further 3% discount is given for credit card
payments.
• Generate reports to support the management such as,
o Details of Regular customers,
o Customers who pay by credit cards (sorted according to the type of credit card),
o Customers who do online reservations,
o Table-wise demand for reservations etc.,
o Total discounts given for credit card customers monthly( sorted according to the type of
credit card),
o Monthly Income for the restaurant,
o Most popular menu items for a given month, year etc.
3. 4
(a)
(i) Identify correct Use Cases from the given list to represent Use Cases designated from UC1 to
UC5 in the Use Case diagram shown below. (15 Marks)
�
UC5
UC1
UC2
Transfer Table
Record Arrival
UC3
UC4
Create Invoice
Display Bookings
SystemUser
<<ST1>>
<<ST2>>
�
�
List of use cases:
A. Get Discount B. Manage Walk-In
C. Manage Payment D. Manage Booking
E. Cancel Booking
�
4. 5
������������������
�
UC1 -
UC2 -
UC3 -
UC4 -
UC5 -
(ii) What are the correct Stereotypes designated as ST1 and ST2 in the class diagram? (05 Marks)
������������������
�
ST1 -
ST2 -
Manage Booking/Cancel Booking
Manage Booking/Cancel Booking
Manage Walk-In
Manage Payment
Get Discount
include
include
5. 6
(b)
Identify the classes from among the given class list which are best suited for classes designated from A to J
in the class diagram given below. (30 Marks)
Hint: A Booking can be a kind of Walk-in or a kind of Reservation.
WalkIn
G
B
C
F
JMenuItem
I
H
E
Table DA
Sitting
List of classes:
A. Payment B. Customer
C. Booking D. Reservation
E. Invoice F. Cash Payment
G. Credit Card Payment H. Invoice Item
I. Dining Menu J. Discount
������������������
�
A -
B -
C -
D -
E -
F -
G -
H -
I -
J -
Booking
Reservation
Customer
Invoice
Payment
Cash Payment or Credit Card Payment
Cash Payment or Credit Card Payment
Invoice Item
Discount
Dining Menu
6. 2
Case Study
A well established computer manufacturer is in need of developing an online shopping system to
enable purchasing of their computers via the internet. Summary of the requirements of the system is as
follows.
Customers should be able to select a computer category from the web page. Available categories at
the moment are Desktops and Notebooks. Each category has a different computer series associated with it.
For example Notebooks will be available in the series ‘Home Premium’, ‘Business Plus’ and ‘Gamer’.
When the customer picks a series from the web page, different models available under the selected series
need to be shown. For example, if ‘Home Premium’ series is selected, models that come under that series
‘Home Premium 2000’, ‘Home Premium 3000’ etc. should be shown. Together with the displayed models,
summary of the default configuration (Processor, Memory configuration etc.) and standard price of the
computer system needs to be displayed.
Each model contains a default configuration which consists of a sub-set of configuration items
available in the system. Each configuration item should hold information about the ‘item type’ which
classifies it into different categories such as ‘Processor’, ‘Memory’, ’VGA’, ’OS’, ’Antivirus Software’ etc.
Each configuration Item should further hold information to describe the item type further. For example if the
item type is ‘Processor’ then a further description such as ‘2nd generation Intel® Core™ i7-2860QM
processor 2.50 GHz’ is needed. Price of the each item should also be available.
When a satisfactory model is picked by a customer, he/she can proceed to place an order for a
computer with the default configuration (Standard Computer) or else can customize the configuration by
selecting the ‘Customize’ option(known as a Customized Computer). If customization is selected, the default
configuration needs to be shown to the customer in detail under different categories such as ‘Processor’,
‘Memory’ with configurable items as pick lists. When each item is selected or changed, the system price
needs to be calculated and shown accordingly.
Once the system configuration is decided, customer can place an order by filling out necessary details such as
shipping address, billing address and shipping method (standard shipping, Express shipping etc). If shipping
address and billing address are the same, option should be there to indicate that both addresses are the same
by filling details for shipping address. Before using the system, the customer needs to log into the online
system with his/her email address and password. If the customer is a new user then, there should be an option
to create a new user account.
Next step of the ordering process is the payment. Full payment needs to be made initially, and only
credit card payments are accepted by the system.
Upon successful payment, a new order (known as ‘Pending’ order) will be created and the order
number and details of the system configuration are sent to the customer via e-mail.
7. 3
Salesperson will process ‘Pending’ orders (which usually take a working day) and then the order
together with configuration details and an invoice is sent to the manufacturing division. Once the assembling
is completed, the computer is sent to warehouse and it will be shipped to the customers shipping address
together with the invoice using the shipping method selected. Order will be updated accordingly whenever it
undergoes these changes so that customer can view his/her order status any time.
Customer can cancel his/her order any time before the order is shipped and a penalty will be
involved for late cancellations.
8. 4
1)
Based on the above case study answer question 1.
(a)
(i.) Identify correct Use Cases from the given list to represent Use Cases designated from UC1 to
UC8 in the Use Case diagram shown below.
UC4
Display Default Configuration
in Customizable Form
UC1
UC3
Select Computer Category
UC2
<<include>>
Select Model
<<include>>
Place Order
UC5
<<include>>
View Order Status Cancel Order
UC6
UC7
<<ST1>>
<<include>>
Customer
Make Payment
UC8
<<ST2>>
List of use cases:
A. Display Default Configuration B. Display Computer Series
C. Send E-Mail D. Select Customization
E. Select Computer Series F. Display Computer Model
G. Update System Price H. Select Customizable Item
(24 Marks)
9. 5
ANSWER IN THIS BOX
UC1 - UC5 -
UC2 - UC6 -
UC3 - UC7 -
UC4 - UC8 -
(ii) What are the correct Stereotypes designated as ST1 and ST2 in the class diagram?
(02 Marks)
ANSWER IN THIS BOX
ST1 -
ST2 -
B
E
F
A
<<include>>
<<include>>
D
H
G
C
10. 6
(b) Identify the classes from among the given list which are best suited for classes designated from Class1 to
Class8 in the class diagram given below.
Credit Card
Payment
Class1 Class2
1 0..*1 0..*
Address
Class4
Class3
1 0..*1 0..*
*
*
*
*
Class8
1
1..*
1
1..*
Computer
1 1..*1 1..*
1
1
1
1
Payment
Class5
Class6
0..*1 0..*1
1..*
1
1..*
1
1 11 1
1
1
1
1
Class7
1
1
1
1
List :
A. Computer Category B. Shipping Method
C. Model D. Invoice
E. Order Status F. Desktop
G. Computer Series H. Order
I. System Price J. Customer
K. Notebook L. Customized Configuration
M. Configuration Item N. Customized Computer
(24 Marks)
ANSWER IN THIS BOX
Class1 -
Class2 -
Class3 -
Class4 -
Class5 -
Class6 -
Class7 -
Class8 -
A
G
C
E
D
H
B
J
11. 7
(c) It was identified that the relationship between ‘Model’ and ‘Configuration Item’ classes is many to
many as shown in the diagram below(One configuration item such as processor may be available in
many models and each model will have many configuration items). Each model will have one ‘Default
Configuration’ associated with it where the relationship between ‘Model’ and ‘Configuration Item’ is
such that one model identifier and Configuration Item identifier can be present in “Default
Configuration’. How can the many-to-many relationship between above classes be refined with respect
to Default configuration? (you may extend the followng diagram).
Model
Configuration Item
*
*
*
*
(10 Marks)
ANSWER IN THIS BOX
Default Configuration
Model
Configuration Item
*
*
*
*
12. 8
(d) Following State Chart Diagram has been drawn to Order Class.
State1 State2
State4State5
State3
Identify the states from State1 to State5.
(15 Marks)
ANSWER IN THIS BOX
State1 - Pending
State 2 - Processing
State 3 - Cancelling
State 4 - Shipped
State 5 - Manufacturing
(e)
There may be certain promotional periods where the computer manufacturer decides to give discounts by
way of providing ‘Coupon Codes’ (Discount Vouchers).
Coupon Code is a unique code and is made available through certain web sites during promotional periods.
There is a validity period for each code (will be valid from a certain date and will expire on a certain date)
Customers can find these codes from these web sites and when the computer is ordered, the coupon code can
be entered. When a coupon code is entered, the system validates it and if valid, the corresponding discount
percentage will be applied to the sytem price and the discount amount and the new price is displayed. If
validation failed, the validation routine will display an error message. Same Coupon code may be used for
different orders but only one coupon code can be used for a single order.
Answer the given questions regarding the above new requirement.
13. 9
(i) Following use case diagram is one way of extending the existing use case model to cater for this new
requirement. You are required to Name use cases and stereotypes. (Only new use cases are shown)
Customer
NUC3NUC2
NUC4Enter Coupon Code
<<NST1>>
<<NST2>>
<<NST3>>
(12 Marks)
ANSWER IN THIS BOX
Customer
Apply Discount and Update
Form
Enter Coupon Code
<<extend>>
Show Error MessageValidate Coupon Code
<<include>>
<<extend>>
(ii) What is(are) the new class(es) that should be there to accommodate the above requirement?
(05 Marks)
ANSWER IN THIS BOX
CouponCode
14. 10
(iii) Write down the attributes of the new class(es)?
(08 Marks)
ANSWER IN THIS BOX
2) (a) Assume that one has identified the following classes for a particular problem domain.
Company, Person, BankAccount
Considering the following business rules, complete the UML model with multiplicity, navigability and role
names/ association names.
• A company can have exactly 7 employees.
• A person can’t have more than one job at a time.
• A BankAccount can have exactly one owner.
• A BankAccount can have one or many operators.
• A person may have zero to many bank accounts.
• A person may operate zero to many Bank accounts.
(40 Marks)
ANSWER IN THIS BOX
Code, ValidFromDate, ValidUntilDate,
DiscountPercentage
Compnay
BankAccount
Person
employer
1 7
1 1..*
0..*0..*
employee
owner operator
15. 11
(b) Consider the following paragraph extracted from a requirement statement.
“Each directory object can have links to zero or more directory objects that play the role of sub directory and
to zero or one directory object that plays the role of parent. In addition, each directory object is associated
with zero or more file objects.’’
Draw a class diagram to reflect the above details.
(25 Marks)
ANSWER IN THIS BOX
(C) Consider the following list.
(i) Money, Australian Dollars
(ii) Bank, Account
(iii) Savings Account, Current Account
(iv) Student, Graduate Student
(v) Continent, Country
(vi) Account, Account324567
(vii) Account, Fixed Deposit Account
(viii) Region, City
(ix) Vehicle, Three Wheeler
(x) Aircraft, Glider
(xi) Book, Chapter
(xii) Aircraft , Engine
(xiii) Car, Tyre
(xiv) Payment, CreditCard Payment
(xv) Employee, WeeklyPaid Employee
Which of the above would form super class-subclass pairs? Mark the correct answers.
(35Marks)
ANSWER IN THIS BOX
i. � ix. �
ii. x. �
iii. xi.
iv. � xii.
v. xiii.
vi. xiv. �
vii. � xv. �
viii.
*****
DirectorySubdirectory
0..*
0..1
File
1 0.*
16. 2
Case Study
A company is in need of a Time Management System for its executives to easily manage their
appointments and schedule their meetings. It is decided that the system would be an extension to the
existing open source e-mail client.
Each executive has a personal calendar consisting of Calendar Entries where he/she maintains
his/her daily appointments. Each entry has the date, description about the appointment, venue (if
any), and start and end times. Planned vacations of each executive are also marked in the Calendar
and each executive is responsible for maintaining this information.
There are a number of conference rooms available for having meetings/presentations. Each
conference room has a specific capacity and different facilities such as overhead projectors
installed, video conferencing capabilities etc. A calendar of its own is there for each room which
can be used to view its availability or unavailability status, duration of bookings and also who has
booked it for each time slot.
The system should provide a facility to view Calendars of any executive and conference rooms and
thereby book a meeting for any available time slot in any day. The anticipated practice would be to
pick a free time slot of the required conference room and book the meeting indicating the day, start
time, end time and participants for the meeting. The system should validate that the conference
room is actually free (somebody else might have booked it during the time period of creating the
booking) and an e-mail message will be received by the meeting organizer whether the booking is
accepted or rejected by the conference room. If successful, individual e-mail messages to each
participant will be sent inviting him to the meeting indicating the date, time and venue for the
meeting. Their calendars (inclusive of conference room) need to be automatically updated with the
details of the meeting. Booking details need to be maintained for each booking to indicate the date
of booking, start-time and end-time. Details of the participants are also stored in the system which
will be needed to manage the responses they send to the invitation as described below.
Upon receiving a meeting invitation, each executive can respond to it in different ways. They can
‘Accept’ the meeting request if they are Ok with the time date etc. If they are not sure whether they
can participate in the meeting the response should be ‘Tentative’. If they are unable to participate
then the response would be ‘Declined’. In all cases, the meeting organizer needs to be informed via
e-mail regarding the response of each participant. Depending on the responses, the meeting
organizer can proceed with, cancel or re-schedule the meeting. When an intended participant makes
a response, the corresponding entry in the participant information stored earlier needs to be updated.
If a meeting is cancelled, all participants are informed by email about the cancellation and their
calendars need to be automatically updated indicating the booked time as free. The conference
room’s calendar should also get updated. It should be noted that a meeting can only be cancelled by
the meeting organizer (person who has scheduled the meeting). All the booking details and
participant information should also get deleted.
If a meeting is re-scheduled then the availability of the conference room is validated as before and
each participant is informed about the change. They need to respond as described above. .
The system should remind all participants about the meeting 15 minutes before the scheduled start
time.
Sometimes it is necessary to schedule recurring meetings. For example there can be a meeting
scheduled to discuss the status of a certain project every Monday at 9.00 AM for one hour for a
designated period of time. The system should be able to cater to this need too. When such a meeting
is scheduled, one booking is created with multiple booking details for each meeting date until the
end date. The conference room and all participants’ calendars should get updated until the end date..
17. 3
1)
Based on the above case study answer question 1.
(a) Identify the actor(s) in the above system.
�
������������������
�
Executive
(10 Marks)
(b) In analyzing the system one has identified Make a Booking, Make a recurring Booking and Validate
availability as some of the usecases in this system. Name and Briefly describe the remaining use
cases that needs to be included in the system.
������������������
a. Rescheduling bookings
b. Cancel booking
c. Validate booking details
d. Respond to invitation
e. View calendar
f. Enter leave information
(15 Marks)
(c) Draw a usecase diagram showing the types of relationships for all identified usecases.
18. 4
������������������
(15 Marks)
Answer the questions from (d) to (g) based on the following description.
One has identified following list of classes in designing the system.
A. ParticipantInfo B. Executive
C. Calendar D. CalendarEntry
E. Booking
Make a
Booking
Re-schedule
booking
Cancel
Booking
Respond to
Invitation
View
CalendarEnter Leave
Information
Recurrence
Booking
Validate
availability
Validate
booking
details
include
Extend
include
include
19. 5
(d) Identify the attributes of CalendarEntry class.
������������������
�
EntryId , Description
Date
StartTime
EndTime
(10 Marks)
(e) With what class(es) does the PartipantInfo class has relationships with?
������������������
�
Booking
(05 Marks)
(f) Draw the type of relationships between the following classes and indicate multiplicity where applicable.
i. Calendar and CalendarEntry
������������������
�
(05 Marks)
ii. Executive and Calendar
������ �� ���� ���
�
(05 Marks)
Calendar CalendarEntry
Executive Calendar
1
1
20. 6
(g).
i. What is/are missing class (es) in the given class listing? Give reasons for your answer.
������������������
�
Class name : ConferenceRoom
To keep conference room information
(15 Marks)
ii. Identify the class(es) from the given class list with which the class(es) mentioned in g (i) has the
relationships?
������������������
�
Booking
CalendarEntry
(10 Marks)
(h) Identify the class(es) that will participate in Making a Booking for a meeting.
������������������
�
Booking, ConferenceRoom, Executive
(10 Marks)
2) (a) Identify the best diagram type(s) that can be used to represent the following.
(i) The physical relationship between software components and the hardware in the delivered system.
����������������������������������������������������������������������������
Deployment diagram
(03 Marks)
21. 7
(ii) Conditions changing within and among Lifelines along a linear time axis
����������������������������������������������������������������������������
Timing diagrams
(03 Marks)
(iii) The message interactions between lifelines
����������������������������������������������������������������������������
Sequence diagram
(03 Marks)
(iv) A set of actions that some system or systems should or can perform in collaboration with one or
more external users of the system to provide some observable and valuable results to the actors or
other stakeholders of the system(s)
����������������������������������������������������������������������������
Use case diagram
(03 Marks)
(v) Specialization of user roles and their interactions with a system
����������������������������������������������������������������������������
Class Diagram
(03 Marks)
22. 8
(b) Consider the following collaboration diagram drawn, to add a new order to the Order Processing
System.
Salesperson
Order Options Form :
OrderOptions
Order Manager :
OrderMgr
Order #1234 :
OrderNo
Transaction Manager :
TransactionMgr
Order Detail Form
: Order
10: Commit( )
1: create( )
3: SubmitInfor( )
4: Save( )
2: Open( )
9: GetInfo( )
5: SaveOrder( )
7: SetInfo( )
6: Create( )
8: SaveOrder( )
(i) Name three (03) different elements of a collaboration diagram. Provide an example for each element
from the above collaboration diagram.
����������������������������������������������������������������������������
(I) Object :
e.g. OrderOptions
(II) Relation/Association:
e.g. association between OrderMgr and OrderNo
(III) Messages:
e.g. GetInfo
(15 Marks)
23. 9
(ii) Draw the corresponding sequence diagram from the above collaboration diagram.
����������������������������������������������������������������������������
Salesperson
Order Options Form :
OrderOptions
Order Detail
Form : Order
Order Manager :
OrderMgr
Order #1234 :
OrderNo
Transaction Manager :
TransactionMgr
1: create( )
2: Open( )
3: SubmitInfor( )
4: Save( )
5: SaveOrder( )
8: SaveOrder( )
10: Commit( )
9: GetInfo( )
7: SetInfo( )
6: Create( )
(30 Marks)
(c) Draw a state chart diagram for the following description given for an order class in an order
processing system.
Once the order is placed the order is being created and the date in which the order is placed is stored.
In order to finalize the order all information regarding the customer and the order items are being
collected. However, while unfilled items are remaining, the order is been treated as a pending order.
Once the order is completed by entering all the items in the order processing system the order is
treated as a filled order which will in turn bill the customer. On the other hand the customer may
cancel the order any time during the initialization or while the order is in the pending stage. If the
order is being canceled the corresponding cancellation date will be stored for further reference.
����������������������������������������������������������������������������
��
24. 2
Case Study
An on-line shopping mall requires the implementation of shopping cart functionality. Following is a
description of the requirements.
Users should be able to browse items on-line and add them to the shopping cart. There need to be
the possibility to view browsed items where a more detailed description of the product is shown.
Even an unregistered user can add items to the shopping cart and proceed to check out the
items(complete transaction), but user need to be authenticated by the system and therefore
registration is mandatory at this point. To register, the users need to provide a unique login-id, First
Name and Last Name, valid e-mail address and a password and there by an account is created for
the user. It is essential to ensure that the password passes the required strength test. A ‘new’ user
will be created in the system and an e-mail will be sent to the given e-mail address with a system
generated verification code and the new user need to enter that verification code into the system in
order to activate his account. User information together with registration information should be
maintained in the system. System will make a user account ‘Suspended’ temporarily for one hour
upon three login failures and after one hour the user account is automatically made ‘Active’. If a
particular user has not performed any activity on the web site for one year then that users’ account
will be suspended by the system too. In both cases the users have the facility to resume the
suspended account by following the instructions provided and make the user account ‘Active’. A
user account may be ‘Banned’ upon any illegal activity.
Registered users will be able to log-in to the system and based on their browsing history, system
need to be able to provide them with a list of recommended products by way of a link called ‘View
Recommended Items’. Pre-requisite for this is that the user is successfully authenticated.
At the time of registration, users can add their billing address and one or more shipping addresses to
the system. The billing address must match with the credit card billing address if they plan to
purchase the items via credit card payment.
Details of products need to be maintained and each product can belong to one or more product
categories such as ‘Electronics’, ’Computer Peripherals’, ’Electrical Appliances’ etc. Current sale
price of the product is also maintained.
A user will have one shopping cart per browser session and all the items added to the cart in that
session will be associated with the cart. It should be possible to edit/delete the added items. When
user proceeds to check-out existing users need to log in (if not already logged–on) or new users
need to register as mentioned before. System will calculate the total amount based on the cart
items. Tax and shipping cost also will be added to the total amount. Payment information needs to
be entered to the system where the user has the option of paying by either credit card or using
‘PayPal’. Shipping address need to be entered as well. It would be easier for the users if they have
maintained their billing and shipping addresses in the system and there should be provision for easy
retrieval of this information. The system should provide the facility to add/edit address information
for registered users as well. A ‘preliminary’ order is created and upon verification of the payment
information, the order is ‘confirmed’. All items checked-out are included in the order and a copy of
the order is e-mailed to the user’s e-mail address. An order knows when the order has been ‘shipped
‘and also when the items are ‘delivered’ to the user. When the order is shipped user need to be
notified via e-mail.
It is not needed to consider implementation details such as Session management; Security etc and
only domain modelling is required.
25. 3
1)
Based on the above case study answer question 1.
(a) Identify the actor(s) in the above system.
(10 Marks)
ANSWER IN THIS BOX
Registered Customer, Unregistered Customer, Credit card payment service,
Paypal
(b) Consider the following description about checkout scenario.
In checking out first the user needs to be logged on to the system (Authenticated). If not user should
be prompted to log on or register with the system. User has the option of viewing and updating the
shopping cart and accordingly the total amount need to be re-calculated. Next the shipping cost and
the amount of applicable taxes need to be calculated. The payment method needs to be specified and
depending on that, the external actors Credit card Payment Service or Paypal Payment service will
verify the payment details.
(i) Two external actors involved with checking out the above scenario are Credit payment service and
Paypal.
Identify the other actors involved in this scenario.
(10 Marks)
ANSWER IN THIS BOX
Registered Customer, Unregistered Customer
26. 4
(ii) If the identified use cases are Checkout, Customer Authentication, View/Update Shopping cart,
Calculate Shipping cost and Taxes, Payment, Payment by Credit card and Payment by PayPal draw
the use case diagram for the Checkout scenario. Show the relationships.
(30 Marks)
ANSWER IN THIS BOX
Checkout
Customer Authentication
View/Update shopping cart
Calculate shipping cost/taxes
Payment
Payment by Credit
Payment by PayPal
Calculate Total
Credit Payment Service
PayPal
<<include>>
<<include>>
<<include>>
<<include>>
<<include>>
Registerd Customer
Unregistered Customer
Prompt to Register
27. 5
(c) Users can view items to see more detailed description of an item. They can view an item by
browsing. Part of the usecase diagram relevant to browse and view an item is given below.
Customer
Browse Item
View Item
<<extend>>
If the users can view an item by browsing or searching for a particular item, show that requirement
by modifying the part of the usecase diagram given above. Indicate correct relations.
(10 Marks)
ANSWER IN THIS BOX
Registered Customer
View Items
<<extend>>
search items
Browse Items
<<extend>>
(d) Draw a state chart diagram for Order object.
(10 Marks)
ANSWER IN THIS BOX
Priliminary Confirmed
ShippedDelivered
Verify Payment Info
Shipped
Delevered
Cancelled
28. 6
(e) Are there any other objects in the system that can be in different states during its lifetime? Name the
states for each identified object.
(05 Marks)
ANSWER IN THIS BOX
User Account
States: New, Active, Suspended, Banned
(f) For the following subset of identified classes draw Relationships and indicate Multiplicity.
Classes: Product_ Category, Product, Order, Order_Item, Account, Address.
(15 Marks)
ANSWER IN THIS BOX
Product_Category
Product
Order
Order_Item
Account
Address
(g) Which of the classes has generalization/specialization relationships?
(10 Marks)
ANSWER IN THIS BOX
Superclass: Payment
Subclasses: Paypal, Credit payment
1 0..*
1
1..*
1*
1
1..*
*
*
29. 2
1) An Information System needs to be developed for „Dream Motors‟ company.
Dream Motors is a company which imports and sells Brand-New and Re-conditioned motor vehicles.
Currently, the company deals only with Motor cars and SUVs. They are planning to expand sales to
passenger vans and motor coaches as well in the near future. Important information regarding each vehicle
are Chassis No, Engine No, Make (Toyota Nissan etc) , Model (Axio, Allion etc), Year of Manufacture,
Country of Manufacture, Cylinder Capacity (1.5 cc, 1.8 cc etc.), Vehicle type (Motor Car, SUV), Fuel Type
(Petrol Diesel), Mileage (0 for Brand New Vehicles), purchased price and selling price.
There are different options that may be available with vehicles such as power mirrors, power shutters,
retractable mirrors, cruise control, multifunction keys, push start etc. Each vehicle may have one or more of
these options.
Information about customers who buy a vehicle needs to be recorded. NIC/Passport number, name, address
and contact number are important.
Customers can pay for a purchase using different types of payment methods. A payment clerk enters the
payment details into the system.
Customers who have purchased vehicles from Dream Motors can upgrade their vehicles after using them for
some years by exchanging the old vehicles with new vehicles. The old vehicle is valued and that value
known as Exchange Value is given as a discount for the new vehicle purchase. Information regarding the
exchange is maintained.
There is a warranty period for vehicles sold by Dream Motors. For a Brand new Vehicle, 50,000 Km
warranty is given and for a Re-conditioned motor vehicle, warranty is for 25,000 km. Customers can claim
for a free repair of the vehicle during this period if some fault occurs. Information regarding such repairs are
also maintained. Customers can view such information after login into the system.
The Manager of Dream Motors should be able to get different types of reports regarding purchases and sales
of the company. Customer details, Vehicle details, Purchase requests, Maintenance Requests are handled by
the Registration Clerk.
(a) Identify the actors in the system.
ANSWER IN THIS BOX
Payment Clerk, Customer, Manager, Registration clerk
(04 Marks)
(b) Identify five (5) usecases for the above system.
ANSWER IN THIS BOX
Payment, Enter Customer Details, Enter Vehicle Details, Enter Purchase Details, Request
Maintenance, Reporting, Inquiry, Exchange vehicles
(10 Marks)
30. 3
(c) „Vehicle‟ is one of the classes identified in the system.
i. Identify five (5) attributes of the „Vehicle‟ class.
ANSWER IN THIS BOX
Chassis Number, Engine No, Make, Model, Year of Manufacture, Country of Manufacture,
Cylinder Capacity , Vehicle type, Fuel Type, Mileage, Purchased price and Selling price.
(05 Marks)
ii. Identify three(3) methods in „vehicle‟ class
ANSWER IN THIS BOX
getMotorCarDetails, getBrandNewMotorVehicles, getJapaneseVehicles,
getReconditionedMotorVehicles, getOptionDetails, getContactDetails
(06 Marks)
31. 4
(d) Customer, Purchase, Repair, Vehicle, Option, Exchange and Payment are some of the classes
identified in designing the system. Identify the relationships between these classes and draw the
class diagram in UML by indicating the multiplicities.
ANSWER IN THIS BOX
(35 Marks)
32. 5
(e) If 1.5% discount and 1.0% discount are given when the purchase is done using a cheque and for a
transaction using a bank draft respectively, how do you modify the class diagram drawn in 1 (d) to
accommodate this requirement?
ANSWER IN THIS BOX
Create 2 new classes as Bank draft and cheque. Inheritance relationship between Payment and
Check , Payment and Bank draft.
(20 Marks)
(f) Payment is one of the scenarios in this system. Name the objects need to communicate in the
Payment scenario.
ANSWER IN THIS BOX
Customer, Payment, Vehicle
(20 Marks)
33. 6
2) (a) Consider the following list of UML models and match the most suitable answer for the given
questions given in the table.
Class Diagram, State Diagram, Component Diagram, Deployment Diagram, Package Diagram, Use
Cases, Collaboration Diagram.
ANSWER IN THIS BOX
Statement Most Suitable Model
A.
How will our system interact with the
outside world?
Use Cases
B.
What objects do we need? How will
they be related to each other?
Class Diagram
C. How will the objects interact?
Collaboration Diagram
D. What states should our objects be in?
State Diagram
E.
How are we going to modularise our
development?
Package Diagram
F.
How will our software components be
related?
Component Diagram
G. How will the software be deployed?
Deployment Diagram
(21 Marks)
(b) Consider the following chain of events for "Borrow Book" use case in a library case study and
the partially completed Communication diagram for the given scenario.
The Customer goes to the librarian and asks for the book “Systems Analysis and Design
Methods by Jeffrey L. Whitten, Lonnie D. Bentey”
The Librarian looks in the index for the name of the book. She finds the index card for the
book, which says that the book is located at shelf 5S.
The Librarian asks the assistant to retrieve the book from shelf 5S.
The assistant gets the requested book and returns it to the librarian.
The librarian checks out the book and hands it to the customer.
34. 7
Librarian
A
B
C
1: Book request
(Title)
6: H
2: D
3: E
4: F
5: G
Identify the labels A-H to complete the Communication diagram for the given scenario.
ANSWER IN THIS BOX
A: Assistant
B: Lender
C: Index
D: Look up (Title)
E: Return infor (Title)
F: Retrieve (Book)
G: Return (Book)
H: Return (Book)
(20 Marks)
.
35. 8
(c) Consider the following class diagram and indicate whether the statements which follow are true or false.
ANSWER IN THIS BOX
Statement True / False
Each Manager manages one or more staff members. True
One or more Staff Member contribute to one Pension. False
Each Manager contributes to one pension. True
Each Staff Member should take at least one Holiday False
Each Manager manages zero or more days of Sick Leave. False
(25 Marks)
36. 2
1. Read the following case study and answer the questions given below.
QCabs is a leading transport service provider in Colombo. Currently the day to day activities of the
company are handled manually. The company is in need of a software system to automate their day to
day activities. Following describes the requirements of the software system for QCabs.
The receptionist at the QCabs company handles the vehicle registration, driver registration, customer
requests, vehicle allocation and payments.
Vehicles owned by the company as well as the outsourced vehicles are used for hiring by QCabs. In
registering the vehicles, details of the vehicles including vehicle no, vehicle type, Company owned or
outsourced, no. of seats, A/C or Non A/C, A/C type , insurance details, revenue license details need to
be recorded and in case of outsourced vehicles the details of the owner including name, address and
contact details are also recorded.
Both the drivers attached to the QCabs company and the drivers of the outsourced vehicles need to be
registered . In registering, the details of the drivers such as the NIC number, name, contact number,
address and driving license number are recorded.
Customers can get the service of the company by visiting the company, making a call to the receptionist
or by using the online reservation system. A Customer needs to provide his name and mobile contact
number with the other hiring details such as the place to go, required date and time and the duration of
the hire at the time of reservation. A text message will be sent to the customer confirming the request
and a vehicle is reserved for the customer. Cancellation of the reservations can be done within 24 hours
after the reservation but 5% of the fee will be charged as the cancellation charges.
Customer who make the reservation online can make the payment online using the credit card. If
payment is by using ABC bank credit card, 7.5% discount is given whereas 5% discount is given for all
the other credit cards. Debit card holders also will get 2.5% discount in making the payment. Cash
payments can be done only from the QCabs office. No discounts are applicable for cash payments.
Receptionists handles the payments.
Availability of the vehicles will be recorded and tracked using the system. In addition the insurance
details, license details, repair details of the company owned vehicles can also be tracked using the
system.
There should be a facility to generate reports regarding hires, payments, cancellations and vehicle
maintenance in the system.
37. 3
a) Identify the actors involved in the QCabs system.
b) “Make reservation” is identified as one of the use cases in QCabs system.
i. Identify the classes involved in “Make reservation” use case.
ii. Identify the relationships among the classes identified in 1.b).i and draw the part of the class
diagram related to “Make reservation” use case showing the relationships and multiplicities.
ANSWER IN THIS BOX
Customer, Receptionist
(10 Marks)
ANSWER IN THIS BOX
Customer, Vehicle, Reservation Details,
(20 Marks)
ANSWER IN THIS BOX
Customer 1 ……….. 1..* ReservationDetails * …….. 1 Vehicle
(20 Marks)
38. 4
c) Name the objects which participate in “Cancel reservation” use case?
d) Identify three (3) use cases other than “Make reservation” and Cancel reservation” in QCabs
system.
e)
i. Identify one example for extend and include relationships in the QCabs Use Case diagram.
ANSWER IN THIS BOX
ReservationDetails, Customer
(10 Marks)
ANSWER IN THIS BOX
Maintain customer Details, Maintain vehicle details , Maintain driver
details, Payment, Allocate Vehicle
(There can be more use cases depending on the assumptions)
ANSWER IN THIS BOX
(Two Possible Answers)
MakeReservation……> Allocate Vehicle …….(include)
Make Payment<---------CalculateDiscount ……..(extend)
39. 5
ii. Model the relationships identified in 1.e).i using above relationships in UML 2.0
2) a) Draw the corresponding activity diagram for the following use case narration.
Use Case Name Farmer Registration
Goal in context This use case describes the event of registering the farmers
with a mobile based agriculture information system using their
National Identify Card (NIC) numbers, names and mobile
phone numbers.
Primary Actor Farmer
Preconditions Farmer should open the application and the user home page is
being displayed.
Post Conditions Farmer has been registered and Farm registration page of the
system is displayed.
Assumptions -
Triggers This use case begins when farmer clicks on the “Registration”
icon or link on the Home page of the application
Typical Course of Events
Step Action
1 The Farmer clicks on the registration icon or link.
2 The system responds by displaying the farmer registration page of the
application.
3 Farmer enters his NIC, name and the mobile phone number and clicks the
[OK] button.
4 The system validates the entered fields.
5 The system sends a PIN number to validate the phone number.
6 Farmer enter the received PIN and click on [NEXT] button.
7 The system displays the “Farm registration” page.
Alternative Courses
4 If the farmer leave any field empty, the system pop-ups an error message
and direct user to step 3.
ANSWER IN THIS BOX
(20 Marks)
Make Reservation
Allocate Vehicle
<<Include>>
Make Payment
Calculate Discount
<<extend>>
40. 2
1. Read the following case study and answer the questions given below.
Chaya Bus Service (CBS) runs a super luxury bus service between Colombo and several other locations in Sri
Lanka. The bus service is in need of a system to handle the ticket bookings. The requirements of the information
system of the CBS are as follows:
CBS maintains a bus schedule. Some of the information includes day (e.g., Mon, Tue…..,Sun), departure time,
arrival time, departure location, arrival location. It should be noted that there may be more than one bus scheduled
on the same day at the same time depending on various factors.
Information on the fleet of busses the CBS has need to be maintained as well. Some important information
includes Bus Registration Number, Make (eg. Volvo, Leyland etc…) and number of seats and their location on
row.(this is needed since seat plan needs to be displayed per each bus to customers while booking) At present
there is only one type of buses(Super Luxury) are in operation but there are plans to introduce Luxury and Semi
Luxury bus services as well since there is a demand. Individual seats per bus is numbered.
Information about the drivers, conductors and passengers needs to be maintained. Each staff member has a staff
id and their role in CBS(Driver Conductor, etc), Address, name, date of birth, NIC, mobile phone number, contact
person, phone number of contact person are important to be available. When it comes to the passengers, their
NIC/Passport Number, Mobile phone number, fixed line phone number, name are important.
There is a need to maintain a specific bus schedule as well. For each schedule of a particular day (for example
Sunday), there could be multiple specific bus schedules on a given date. A particular bus will be allocated to one
specific schedule together with the relevant staff members. Seat price for each is also allocated. The price will be
same for any distance between the start and destination. There should be facility to specify whether this particular
schedule is cancelled or available.
Booking of seats
Passengers can book seats on a specific bus schedule as follows:
• Select a day, departure location, arrival location and departure time
• System displays specific schedules for the day matching given criteria
• Passenger selects one schedule
• System displays the seating plan for the allocated bus (free and available seats)
• Passenger selects required number of seats and confirms
• System reserves these seats temporarily and displays the total cost,
• Passenger can proceed for payment or Cancel
Payment
If the passenger decides to proceed with the booking he/she can make the payment as the next step.
41. 3
• System will display the payment information including total cost, number of seats, departure and destination
locations, date and time selected by the passenger.
• The required passenger information including name, NIC/Passport number, mobile number, fixed line phone
number and email address needs to be entered.
• Passenger can select either credit card or Paypal options in making the payment.
• The system will validate the payment information.
• If successful a receipt will be generated with the following information and also text message is generated and
sent to the mobile.
Receipt number, Date and Time of departure, Departure and Arrival locations, Bus registration number,
Contact number of the conductor, Seat number(s)
Passengers need to show their ticket/ text message received to the conductor at the start of the journey. If there
are any delays a SMS will be send to the passenger indicating the delay.
a) Identify the actors and draw the Use Case diagram for the booking system.
43. 5
b) According to the requirements described, two classes can be identified as ‘Schedule’ to maintain
bus schedule details and ‘Journey details’ to maintain details about specific journeys.
i. Model the relationship between the two classes using UML showing the multiplicities.
ANSWER IN THIS BOX
(15 Marks)
ii. Write down the attributes of each class ‘Schedule’ and ‘Journey details’?
(15 Marks)
c) Consider the following Diagram. Where do you include the booking details of the system?
Modify the following diagram to show your answer.
ANSWER IN THIS BOX
(i) Schedule – Schedule_id, Day, Departure time, Arrival time, Departure location, Arrival
location -
(ii) Journey-details - Journey_id, Date
Passenger Journey details
*
*
Journey detailsSchedule
1 *
44. 6
(10 Marks)
d) Identify and model the classes involved in a generalization/specialization relationship in the system.
.(10 Marks)
e)
Identify the most appropriate classes to add the following attributes and methods in the booking
system.
Write down if there are any assumptions.
i. Seat Number
ii. Route number
iii. Make booking()
iv. Get Employee name()
ANSWER IN THIS BOX
Using an Association Class
ANSWER IN THIS BOX
Person
Passenger
Booking
Journey_details
* *
45. 7
v. Specify bus()
(20 Marks)
2) a) Consider the following use case narration which describes the event of a member service assistant
entering a new product order that has been submitted by a member of the ABC Private Ltd.
Action System Response
Step 1: The member services associate
request the option to enter a new order.
Step 3: The member services associate
provides the member ID.
Step 5: The member services associate
verifies the demographic information
(shipping and billing address). If changes are
required update the information and respond
accordingly.
Step 7: The member services associate enters
the ID and quantity of each item provided.
Step 2: the system responds by prompting the
user to enter the ID of the member submitting
the order.
Step 4: The system retrieves the member’s
demographics information on file and
displays it to the user.
Step 6: The system responds by prompting
the user to enter the ID and quantity of each
item to be ordered.
Step 8: For each product ordered, the system
validates the product identity.
Step 9: for each product ordered, the system
verifies the product availability and
determines an expected ship date, determines
the cost of the total order if an item is not
ANSWER IN THIS BOX
Attribute Class
i. Seat Number Bus
ii. Route number Schedule
iii. Make booking() Booking
iv. Get Employee name() Employee
v. Specify bus() Journey
46. 2
1. Read the following case study and answer the questions given below.
ABC Company is planning to start up an online store which sells Books & Blu-Ray Movies. They are
planning to set up a computerized system and simplified preliminary domain requirements summary is as
follows:
Registration with the system
The customers if they wish can register with the system by creating a user account. Information required
for registration is username, password, date of birth and a valid e-mail address together with their first
name and last name. Optionally they can enter their billing address and shipping address as well while
registering with the system even though it is possible to do so after registration as well. Upon successful
registration a new user is created and the system should send an activation code to the e-mail address
provided. User will have to enter this code at the first-time login to the system to make the user active.
Username and password has to be specified when login into the system. System should validate the login
information provided and display appropriate error messages. If user fails to enter correct information
within three attempts, the user needs to be locked for 10 minutes and informed via e-mail. After 10 minutes,
account should become active again.
Customer can request to close the user account if required. Administrators can close a user account for
violation of system policies as well. Managing the user account should be possible enabling the user to
change their password and address information.
It is possible for unregistered users to browse the system and view product details.
Administration Users can only be created using a separate flow which is not visible to ordinary users.
Administration users can log on to the system to do administration functions such as adding, modifying,
removing products, setting product prices etc.
Browsing/Searching Products
Customers should be able to browse a list of products (i.e. Books and Blu rays). When a listed product is
selected, details about the product need to be displayed. It should be possible to search for products using
key words such as title, author for books and Movie title for Blu-Rays. Advanced searching facility should
be there for customers if required, where more searching attributes are available. When a customer clicks
on a search result, details of the product need to be displayed.
Wish List
Wish list can only be created by the registered customers and they should be logged on to the system to do
so. While browsing/Searching, customers should be able to add products they find interesting, to the wish
list. The items added to the wish list need to be persistently stored so that the wish list is available on next
log on. Managing the wish list is totally up to the customers and they should be able to add, remove
products from it as they wish. When the user logs on to the system, they should be able to browse and view
products previously added to the wish list.
Shopping cart
A logged on customer can add any number of products to the shopping cart while browsing or from the
wish list. It should be possible to view the shopping cart, remove items from it at any time. Shopping cart
information need not prevail after the closure of the browser window. When the user is ready, he/she can
proceed to check out the shopping cart.
Checkout Shopping Cart
Customer needs to be logged on to the system to perform this action
When the checkout option is selected, products in the shopping cart need to be displayed to the customer
where he/she can alter the default quantities (i.e. one) of each product if required. Total price for the
products in the cart need to be displayed as well.
Customers should be able remove items from the cart and go back and add more items. Total price should
be updated with these alterations
47. 3
Placing Orders
Customer needs to be logged on to the system to perform this action
Customers can place orders based on the products in the shopping cart while in the checkout process. The
shipping address should be displayed (if provided at registration) and if he/she wants to ship to a different
address, then entering a different address should also be possible. Shipping charges for the order is also
displayed and added to the total order amount. Shipping charges are obtained from Courier Service system.
Payment for the order
Payments for orders can be done via credit card or using PayPal account. Payments are handled by a
separate accounting module and need not be considered. The payment information is transferred to the
accounting module and information provided by accounting module can be received by the system
Order Confirmation
Once the order is successfully placed, a confirmation e-mail and an invoice need to be sent to the user’s e-
mail address.
Delivery
Products, ordered will be delivered to customers by external courier service. The system will interact with
the courier Service system to keep track of the delivery.
Order Status
Registered Customers can view their order status any time after placing the order by using the system.
Order will be created as new and other connected systems will send information whenever something new
happens to the order. The information such as whether the order is being Processed, Packed, Dispatched,
delivered, and closed are important for customers.
a) (i) The following use case diagram models the “Browse products” scenario. Complete the
diagram by identifying the relationships. Clearly indicate the stereo types <<include>> and
<<extend>>.
(20 Marks)
(ii) The following use case diagram models the scenario “Register with the system” where a
customer attempts to register with the system. Complete the diagram by indicating clearly the
relationships and stereo types (Hint: <<include>> and <<extend>>).
(10 Marks)
ANSWER IN THIS BOX
48. 4
ANSWER IN THIS BOX
(ii) Identify the actors involved in “Place Order” Scenario.
(3 Marks)
b) (i) Draw the relationships between the classes given below using UML notation.
(ii) Indicate the multiplicities appropriately.
(Hint: Relationship types may be generalization/specialization, aggregation, composition, or
association)
(35 Marks)
ANSWER IN THIS BOX
Customer, Accounting Module, courier Service System
49. 5
c) Draw a state chart diagram for the class “Order”.
(06 Marks)
ANSWER IN THIS BOX
ANSWER IN THIS BOX
50. 9
(b) . Consider the following use case narration which describes the scenario of a specially designed
telephone box used to take telephone calls using a credit card.
Use Case Name : Take a telephone call using the credit card
Participant: User
Credit card processing center
Entry Conditions: User has a valid credit card
Credit balance should be sufficient for the minimum amount
required to take a phone call.
Exit Conditions: User hangs the receiver
Credit card is returned to the user
Flow of Events:
1. The user inserts the credit card.
2. Telephone box sends the message to the card center.
3. Card center processes the card.
4. Card center sends the available credit to the Telephone box.
5. Telephone box processes the available balance.
6. Telephone box shows a message for the user to pick up the receiver.
7. User picks up the receiver.
8. Telephone box displays the number pad to the user on the screen.
9. User dials the number and makes the phone call.
10. Telephone box processes the duration/amount.
11. User ends the phone call by pressing the ‘END’ button / hanging the receiver.
12. Telephone box displays the total phone call duration and the amount.
13. Telephone box sends the amount to the card center.
14. Card center charges the amount from the credit card.
15. Card center sends the confirmation to the telephone box.
16. Telephone box displays the message ‘THANK YOU, COME AGAIN”.
17. Telephone box ejects the credit card.
Exceptional conditions and alternative flow of events:
When the credit is not sufficient to make a call
5.1 Display error message and Go to 17
When the amount exceeds the credit card balance
10.1 Ends the phone call and Go to 12
51. 10
i. Draw a sequence diagram to represent the above scenario.
(40 Marks)
ANSWER IN THIS BOX
52. 11
ii. Draw the relevant collaboration diagram for the above sequence diagram.
(30 Marks)
ANSWER IN THIS BOX
53. 12
iii. The following table shows a comparison between sequence diagrams and collaboration diagrams.
Complete the following table using the relevant text given on either side of the table.
(10 Marks)
ANSWER IN THIS BOX
Sequence Diagram Collaboration Diagram
Sequence diagrams are used to examine the
behaviour of objects within a single use
case.
Collaboration diagrams are used to
examine the behaviour of objects within a
single use case.
Sequence diagrams are known as
Interaction diagrams.
Collaboration diagrams are known as
Interaction diagrams.
In a sequence diagram, a set of objects are
arranged according to the time sequence.
Collaboration diagram doesn't show object
interaction in timely manner.
Sequence diagrams illustrate interactions in
two dimensions and each new object is
added to the right.
Collaboration diagram has only one
dimension and objects are placed
anywhere on the diagram.
Clearly show time ordering or sequence of
events.
In collaboration diagrams it is difficult to
see the sequence of messages.
**********
54. 2
1. Read the following case study and answer the questions given below.
“Pit Stop” is a vehicle service station located in Colombo Sri Lanka. They are planning on
implementing an Information System to enhance their current organisational activities. They
provide vehicle maintenance services such as wheel alignment and interior cleaning.
Initially, the customer can register in the system by filling a form which consists of the first name,
last name, valid email address, valid mobile number, home address and password. Once this
information is provided, the user will be granted access to the customer interface.
After registration, customers are required to enter their email address and password to access the
customer interface. If the email address or password is invalid, a message will be displayed on the
login screen. Every time when a customer logs in, appropriate validations are carried out and if the
credentials are incorrect, necessary error messages will be displayed on the login screen.
Services provided by the organisation can be searched by any user with or without being logged
into the system. However, if they want to book a service they must be logged into the system.
Services could be searched by typing in keywords or filtering services via the types of services
available. Once the customer selects a service, information will be displayed regarding the
particular service including prices, service limitations etc.
Registered customers have the ability to book an appointment for any service provided by the
organisation. The customer needs to select the service type, service date and service time in making
a booking. Then the system will notify the customer whether a service slot is available for the
customer’s preferred date and time. If the customer wishes to place the appointment, the vehicle
number needs to be entered to the system. An SMS alert containing the details of the booking
including the appointment id, date and time will be sent to the customer after completion of the
booking.
When a customer brings the vehicle for the appointment, service advisers would take down the
mileage and any special requirements and issue a job card. Sometimes it may be necessary to view
the previous service records to find details such as when (at what mileage) the gear oil/engine oil
change was done and what brand of oil was used etc. The job card needs to be signed by the
customer in order to give his/her consent to the service.
Once the service is done, an SMS will be sent to the customer with service and payment details.
The customer will be given a choice to make the payment using a credit card or pay by cash.
However, if the customer pays using a “JLM” credit card, a 5% discount will be given on the total
price. Moreover, once the service is completed, the customer will be notified via email to provide
feedback for the quality of the service provided. A feedback interface for the particular appointment
will be visible once all the service processes are completed for the given appointment_ id. Then the
customer can provide feedback and give a rating for the service provided by the organisation.
The customer interface will also display information about the current appointment and past
appointments of the particular customer. The customer has the ability to request to change the
appointment information or cancel an appointment.
The Manager can generate a set of reports in the areas of service profitability and service demand.
Further, the Manager can see all the current appointments and make any changes if necessary. If
the Manager modifies any information regarding a customer appointment, the customer will be
notified via SMS.
The Manager has the ability to create, update or cancel the services provided by the company.
Moreover, the manager will have access to customer feedback and ratings for all the
appointments.
55. 3
(a) Identify the Actors involved in the “Pit Stop” system.
[10 Marks]
(b) Model the “Login” scenario using the following use cases.
Login, Validate user, Display error message.
Draw the Use case diagram by identifying the relationships. Clearly indicate the stereo types
<<include>> and <<extend>>.
[10 Marks]
ANSWER IN THIS BOX
ANSWER IN THIS BOX
Customer, Manager
56. 4
(c) The following use-cases are identified in the “Service Booking” scenario.
Search service, Select service, Display service information, Validate User, Make booking, Check
user login.
Draw the Use case diagram to model the above use cases by identifying the relationships.
Clearly indicate the stereo types <<include>> and <<extend>>.
[30 Marks]
ANSWER IN THIS BOX
57. 5
(d) Identify and model the classes involved in a generalization/specialization relationship in the “Pit
Stop” system.
[20 Marks]
(e) What is the most appropriate method to model the Discount information in the class diagram?
Give reasons for your answer.
[10 Marks]
ANSWER IN THIS BOX
ANSWER IN THIS BOX
Add a separate class as “Discount”
As there are different discounts for different payment types or any other valid reason
58. 6
(f) Model the part of the class diagram involved in Service Booking scenario showing the
relationships and multiplicities among the classes “Customer”, “Service_Booking”, “Service” and
“Vehicle”.
[20 Marks]
ANSWER IN THIS BOX
59. 7
2
(a) Select the most suitable word to fill in the blanks from the list of words below and write down
your answer in the box provided.
[15 Marks]
List of Words: Inheritance; Polymorphism; Encapsulation; Abstraction; Information hiding;
Composition; Interface; Realization
i. The most critical skill required by modelers is to identify what to include in a model and
what to leave out from the model. This concept in OOAD is known as …………………….
ANSWER IN THIS BOX
Abstraction
ii. ………………………… enables the modelers to define operations in different classes
using the same name.
ANSWER IN THIS BOX
Polymorphism
iii. ……………………… is also known as information hiding.
ANSWER IN THIS BOX
Encapsulation
iv. The relationship between a class and an interface is known as ……………..
ANSWER IN THIS BOX
Realization
v. The relationship between two classes which lets one to reuse the attributes and methods in
the other class is known as …………………….
ANSWER IN THIS BOX
Inheritance
60. 8
(b) Write down short answers for the following.
[16 Marks]
i. Name three (03) static diagrams drawn in UML.
ANSWER IN THIS BOX
Deployment
Class
Object
Component
ii. List down one (01) similarity and one (01) difference between classes and use-cases.
ANSWER IN THIS BOX
Similarity: Both can inherit
Difference: classes consist of attributes and operations; use cases consists of scenarios.
iii. List down three (03) purposes of drawing a state chart diagram.
ANSWER IN THIS BOX
To Describe different states of an object during its life time.
To Model the dynamic behaviour of a system.
To show the events or messages that cause a transition from one state to another.
61. 11
card details to reserve the tickets. In case of cancellation the passenger should visit the
reservation office to do the cancellation. He/she has to fill a form and should hand it over to
the reservation clerk to cancel the tickets. Upon that request, the reservation clerk will cancel
the tickets and refund the amount to the passenger. All cancellations will be subject to a
cancellation fee.”
i. Identify six (06) classes for the above Scenario.
[12 Marks]
ANSWER IN THIS BOX
Train
Passenger
Seat
Payment
Ticket
Station
ii. Clearly specify attributes and operations for two (02) classes identified above (d-i).
[08 Marks]
ANSWER IN THIS BOX
Class: Passenger
Attributes: Name, Address, Age, gender, NIC
Operations: searchTrain(), reserveTickets(), makePayments()
Class: Ticket
Attributes: ticketNumber, startingLocation, endingLocation, passengerNIC
Operations: amount (), cancelTicket ()
62. 12
iii. Draw a class diagram for the above railway ticket reservation system, illustrating the
relationships and multiplicity.
[25 Marks]
ANSWER IN THIS BOX
**********