First, use the Alf project template to create a new project called StopWatch. Next, define a stopwatch Class and its attributes using a Class diagram.
To create a StopWatch Class (on a Class diagram in a new Package)
Right click Model in the Model Browser and select Create Element > Package. A new Package will be created under the Model node. Name the created Package system (see the following figure).
Name the class diagram System.
You can also use the context menu of the system package to create a new Class diagram by right-clicking the system package and selecting Create Diagram > Class Diagram. |
Now add a time attribute to the StopWatch class. Since this attribute represents the elapsed time in seconds, type it as Integer.
To add a time attribute to the StopWatch class