|
|
|
| |
Tutorial exercises - Modelling 1
- Study book Q3.6.
Draw a sequence diagram for a simple cash
transaction at a shop. There are two objects: the buyer and the
seller. One item only is being purchased.
- Study book Q3.10.
Draw an activity diagram showing the
process of getting yourself a drink. It should include the possibility
of
you wanting a hot drink (say tea or coffee) and a cold drink
(e.g.~water,
fruit juice or soft drink). For the hot drink preparation, show how
activities can occur in parallel: namely the heating of water and the
preparation of the mug/teapot/coffee jug.
- Study book Q3.11.
A car's automatic transmission can be in one of
4 states: Park, Reverse, Neutral or Drive.
A gear lever selects these states, and they are arranged in a linear
sequence in the order shown:
So from P one can only move to
R, while from N one can move to either R or D.
- Show the transmission state using a statechart.
- Modern cars often do not allow the gear selector to be moved out
of
P or N unless the foot brake is depressed. Augment your
diagram (with a concurrent state) to show this.
- The engine can only be started when the lever is in P or
N. Show this by adding a third concurrent state.
- Draw a DFD to describe a retail shop.
Draw a context diagram and a level
0 diagram. Here is a description of operation of the business.
- A customer selects one or more items and presents them for sale to the
sales assistant. The item codes (bar codes) are noted and a total cost
is then determined. The item cost is stored on the stock file. The
customer pays the total and is presented with a receipt. The stock file
is modified to show the amount of stock now held in the store.
- A customer may place an item on lay by. Periodic payments no less than
20% of the price per month can be made. Payments can be made at any
time. The customer receives a receipt for each payment which also shows
the remaining balance. If lay by payments are overdue a letter is sent
to the customer.
- The shop orders new stock from a number of suppliers. Stock is ordered
once per week. Stock orders are generated either by staff, who directly
request the numbers of items to be ordered, or by a weekly scan of the
stock file. An item whose stock is less than its reorder number will be
ordered.
- A supplier delivers new stock together with an invoice. The invoice is
checked against the delivered stock to ensure all items have been
delivered, then is sent to the accounting department for payment to the
supplier.
|
| |
|