You are on page 1of 4

Object Oriented Systems Software Engineering Page 1 of 4

Instructions

Please read the following instructions carefully:

For this open book exam, you are required to analyse problems to determine appropriate object-
oriented methods down to detailed design. In your answers you are required to cover/address
the criteria listed below making sure that your answer is contextualised and specific to the
given scenario.

You are required to submit your answers through Moodle. All answers will be submitted to
Turnitin and similarities to online sources or other student’s work investigated accordingly.

SECTION A (Compulsory)

QUESTION A

The following is a description of a library:

A book can have several copies which are stored in the library. Books are identified by
an ISBN and book copies also have a copy number. When borrowing a book the
borrower finds the bookcopy on the shelf and waits in a queue before presenting his/her
card with a UserId on and the bookcopy to borrow. The system (via the librarian)
validates the UserId and ISBN and copy number before displaying the user and book
details on the screen. The details of the loan are recorded. A book can be reserved by a
member in which case when a book copy is returned it is put behind the shelf instead of
back in the library.

Design an object-oriented system based on the above scenario (making assumptions


only if details are not clear in the description).

(a) Produce a class diagram for the above scenario.


[5 Marks]

(b) Generate a sequence diagram that best describes the use case “borrow book” for
the library scenario.
[5 Marks]

(c) The behavior of a use case may be specified by using other UML diagrams like a
sequence diagram or an activity diagram. Discuss in detail the differences
between sequence and activity diagrams in specifying the behavior of a use case.

[10 Marks]

[Total: 20 marks]

Level M Asia Pacific University of Technology & Innovation 202108


Object Oriented Systems Software Engineering Page 2 of 4

SECTION B (Answer any two (2) Questions)

QUESTION B1

We want to develop a scoring system of a fictitious game. In the game, players must
run around a circuit that includes a series of checkpoints. At each checkpoint, the player
must throw projectiles at a target. Points are scored for successful hits and removed for
a slow time around the entire circuit. It may be that men, women and children use
different scoring systems. In this case, a set of scoring algorithms could be developed
and the decision of which to use be made at run-time, according to the sex and age of
each competitor. The calculation of the score will use one of three sets of rules
according to the type of player. The scoring rules are as follows:

i) Men. One hundred points will be awarded for every target hit. Five points will
be subtracted for each second of time taken.
ii) Women. One hundred points will be awarded for every target hit. Four points
will be subtracted for each second of time taken.
iii) Children. Two hundred points will be awarded for every target hit. Two points
will be subtracted for each second of time taken.

(a) Assess how the Strategy Method design pattern can be used in this situation.
(4 Marks)
(b) Provide Java code snippets in applying the Strategy Method design pattern here.

(6 Marks)
(c) Supply a suitable UML class diagram to encompass this scenario.
(5 Marks)
[Total: 15 marks]

Level M Asia Pacific University of Technology & Innovation 202108


Object Oriented Systems Software Engineering Page 3 of 4

QUESTION B2

Consider the control panel of a simple media player. When the device is playing MP3
music, the "play" button could pause and restart the music. When the user is listening to
the radio, the same button may search for the next radio station. To switch between the
states of MP3 playback, radio tuning and standby mode, the user could press the "audio
source" button. We need to simulate a simple MP3 player that has two buttons. The two
buttons on the media player, "Play" and "Audio Source". The MP3 player will have
four possible states. The states will be "MP3 Playing", "MP3 Paused", "Radio" and
"Standby". The behavior of the two buttons will vary according to the currently
selected state. The actions for each button will be as follows:.

State Play Button Audio Source Button


Standby No effect. Switch state to "MP3 Playing".
MP3 Stop music, switch state to "MP3 Switch state to "Radio".
Playing Paused".
MP3 Start music, switch state to "MP3 Switch state to "Radio".
Paused Playing".
Radio Tune next radio station. Switch state to "Standby".

(a) Describe a suitable design pattern that may be used in this scenario to alter the
behavior of an object as its internal state changes. The pattern should allow the
class for an object to change at run-time without changing the interface used to
access the object or losing the current state.
(6 Marks)
(b) Using a suitable class diagram, describe the structure of an application to meet the
requirements stated above.                      
(5 Marks)
(c) Indicate the key advantages of the pattern identified in part (a) by providing at
least TWO (2) such benefits.
(4 Marks)

[Total: 15 marks]

Level M Asia Pacific University of Technology & Innovation 202108


Object Oriented Systems Software Engineering Page 4 of 4

QUESTION B3

Consider textual description below for a use case “Withdraw Money using Visa Card”
from ATM case study.

(a) Elaborate the significance of “Main Success Scenario” in use case description.
Using the above scenario as example, differentiate between “Main Success
Scenario” and “Error Sequence” in context of use case description.
(8 Marks)
(b) Based on the given Main Success Scenario, produce a detailed Sequence
Diagram.
(7 Marks)

[Total: 15 marks]

Level M Asia Pacific University of Technology & Innovation 202108

You might also like