Online Store Application Design  -  continue

 

 

From the description of the IC cards, we come up with the finite state machine for each IC.

 

 

                             Finite State Machine for Company IC

  

 

 

 

 

 

 

 

 

 

 

 

 

 

Explanations:

 

S00 : initial state. When it receives order information from the customer, it changes to S01.

 

S01 : Action performed is to add the order to its’ records. Outputs “search for availability” message to the store IC.

 

S02 : When receives “Available” message at S01, it will change to state S02. Action performed is to determine which store should

       deliver the order. Output “deliver” message to the selected store. Outputs “ Order Available” message to the customer IC.

 

S03 : When receives “ Already Delivered” message from the store IC, it will change from S02 to S03.  Action performed at this state is

        to delete the order from the recorders and to charge customer’s credit card.

 

S04 : When receives “ Not Available” message at S01, it will change from S01 to S04. Action performed is to delete the order in the

        Records. Outputs “Order Not Available” message to the customer IC.