Programming Assignment Unit 3
Programming Assignment Unit 3
1. Owner: The main user of the garage door, who controls it using a manual button switch or
remote control.
2. Motion Detector Sensor: Turns on the exterior lightbulb when it detects movement.
3. Garage Door System: Manages the mechanism for opening and closing in accordance with
4. Electric Eye Sensor: Provides security by identifying obstacles beneath the garage door that is
closing.
5. Remote control system: Wireless garage door opener functioning is made possible by the
Question b: Derive only the use cases relevant to the system objective and write
Description: For security and visibility reasons, the system automatically activates the external
Description: The owner opens the garage door by pressing a button on the remote control, which
Description: If the electric eye sensor is clear, owner can direct the system to close the garage
Description: To prevent accidents, the system reverses the garage door and stops it if the electric
+----------------------------------+
+----------------------------------+
/ | | \
/ | | \
| | | | |
| | | | |
[Open/Close Door] [Detect Motion] [Check Obstacle] [Send Signal] [Press Button]
| | | | |
[Obstacle Detected]
Question d: For the use case that deals with the remote-controlled garage door
For convenience, the owner would like to be able to remotely open the garage door.
System: Needs to make sure the garage door runs securely and smoothly.
Preconditions:
5. The mechanism makes sure that nothing gets in the way of movement.
6. The mechanism completes the process when the door fully opens.
Extensions:
1. The system will not respond if the remote control signal is weak, and the owner will be
2. The system stops working and notifies the owner if it detects an obstruction.
Question d: Draw the system sequence diagram(s) for the use case selected in (d)
| | | | |
| Press Button | | | |
|--------------------> | | | |
| | Send Signal | | |
| |------------------> | | |
| | | Activate Motor | |
| | |----------------------> | |
| | | | Door Moving |
| | | |------------------>|
| | | Check Sensor | |
| | |----------------------> | |
| | | | Obstruction? |
| | | |<------------------|
| | |<---------------------- | |
Question e: Show the operation contracts for the operations of the use case selected
in (d)
Responsibilities:
2. Make sure the electric eye sensor and other safety features are turned on.
Preconditions:
1. The remote control sends a legitimate signal to the system, which is operational.
The post conditions:
Ambler, S. (2003-2018). UML 2 Use Case Diagrams: An Agile Introduction. Agile Modeling.
http://www.agilemodeling.com/artifacts/useCaseDiagram.htm
Bell, D. (2003, June 14). An introduction to the Unified Modeling Language. IBM
DeveloperWorks. http://www.ibm.com/developerworks/rational/library/769.html
Marsic, I. (2012, September 10). Software Engineering. Rutgers: The State University of New
Jersey. https://my.uopeople.edu/pluginfile.php/57436/mod_book/chapter/46513/
CS4403MarsicTextbook.pdf