CSCI 211 Sample Exam Problems for Practice

 

1)     The figure below is a class model for this exercise.  Sender and Receiver are the only classes with important dynamic behavior. 

a)     Construct a sequence diagram for the following scenario: Sender tries to establish a connection to the receiver by sending the start of transaction packet.  The receiver successfully reads the packet and replies with an acknowledgment.  The sender then transmits a start of file packet, which is acknowledged.  Then, the file data is transmitted in three acknowledged packets, followed by the end of file, and end of transaction, which are also acknowledged.

b)    Construct a sequence diagram in which sender packets are garbled.  Revise your answer in part a) to create this sequence diagram which includes the errors caused by noise corruption of each type of sender packet.

c)     Prepare a state transition diagram for a Sender object.

d)    Prepare a state transition diagram for a Receiver object.

 

 

 

 

 

2)     a) Write a scenario for inserting and playing a Compact Disk (CD) on a 6-disk CD player with these controls: an “on/off” button, a “play” button, a “stop” button, and “selection” buttons (numbered 1 through 6).  The CD player also has an “open” button that opens up the player to allow insertion/removal of a 6-disk cartridge.

b) For the CD player described above, build a state transition diagram.

 

 

3) Use inheritance (generalization) to improve the class model for a file system shown in Figure E8.10 below: