Sequence Diagramming Exercises
1. Name the four numbered elements in this diagram:
2. Identify the errors in notation in this diagram:
3. Identify the logical error in this sequence diagram:
4. Identify areas for improvement in this sequence diagram (original article):
View partial solution.
5. Reverse engineer the source code provided for this
simple
calculator
application. Draw a sequence diagram for the
"multiply" use case, and one for the "clear" use case. You
may use a sequence diagram drawing tool or hand-draw a neat
illustration.
There is a defect in this application. Use the sequence diagrams
to trace the execution to see if you can determine the defect.
6. Review the class
diagram for the Mix Tape Calculator application. Draw the
sequence diagram for the use case for moving a song from the song pool
to the play list. Specifications for the essential methods are
below. You may use a sequence diagram drawing tool or hand-draw a
neat illustration.
In the MixTapeModel class:
/** Move a song from the pool to the playlist.
* @param position the zero-based index of the song to be moved.
* @return true if the song was added to the playlist, false if adding
* the song would have exceeded the current tapelength time.
*/
public boolean addToMix(int position)
In the PlayList class:
/** Determine if the tape has room for a specific song.
* I.e., if this song were added to the playlist, would it
* exceed the tape's capacity?
* @ return true if the song can fit, false otherwise.
*/
public boolean hasRoom(Song newSong)
/** Accessor to the available time remaining on the tape,
* that is, unused space.
* @return remaining time
*/
public TimeDuration getRemainingTime()
/**
* Adds up the total time taken by the current songs in this play list.
* @return SongDuration total time in minutes and seconds
*/
public TimeDuration getTotalTime()
Submit a PDF containing your written responses to questions 1 - 4, and 5,
and an image of the sequence diagram you created for questions 5 & 6.
Place both student names at the top of the page. Only one submission is needed per student team. Do not submit zip file.
instructor
solution