Class Account:S// point to current stateLS[0] // point to start stateLS[1] // point to idle stateLS[2] // point to ready stateOperations: create(){ S->create() currState = S.getID() IF currState == 0 THEN S = LS[1] //change ATM state from “Start” to “Idle” ENDIF }Open(int p, int y, int a){S->open(p,y,a);currState = S.getID() If(currState == 1) then AccountData ad = new AccountData(p,y,a,”active”); End if}Pin(int p){S->pin(p)currState = S.getID() IF( currState = 1 && p == ad.getPint()) Set S = LS[2]; END IF}
Found this document preview useful?
You are reading a preview Upload your documents to download or Become a Desklib member to get accesss