CpSc 461, Software Engineering Techniques
CRC Card and State Machine Exercises
In this exercise you will be working with your team to model a pay telephone. Local calls from the pay phone cost $0.35, and the phone accepts quarters and dimes. Use your everyday experience with pay phones as a guide, but don't forget the following:
- Some calls (e.g., 911 for an emergency or 0 to get the operator) should be free
- Some calls may be placed collect or via a calling card
- Hanging up the phone prior to dialing should return any coins that have been inserted
CRC Cards (1 hour)
Use the provided index cards to create a CRC model of the problem, using the example on p. 208 of the textbook as a guide.
State Machine (due March 14 at the beginning of Lab)
Create a state diagram for the pay phone, using the diagrams on pp. 199 and 219 of the textbook as a guide.