|
|
|
|
|
by kazinator
3527 days ago
|
|
Just the raw formatting of that could be improved, by cuddling up ELSE IF from separate lines. Aren't there some END tokens missing? Let me put them in: IF card is valid DO
IF card owner is valid DO
IF request withdrawal DO
IF authorization code is valid DO
query for amount
IF request <= current balance DO
IF withdrawal <= available cash DO
vend currency
debit account
ELSE
message
terminate session
END
ELSE
message
terminate session
END
ELSE
message
terminate session
END
ELSE
IF authorization code is valid DO
query for amount
accept envelope through hatch
credit account
ELSE
message
terminate session
END
ELSE
eat card
END
ELSE
message
END
Okay, now: IF card is valid DO
IF card owner is valid DO
IF request withdrawal DO
IF authorization code is valid DO
query for amount
IF request <= current balance DO
IF withdrawal <= available cash DO
vend currency
debit account
ELSE
message
terminate session
END
ELSE
message
terminate session
END
ELSE
message
terminate session
END
ELSE IF authorization code is valid DO
query for amount
accept envelope through hatch
credit account
ELSE
message
terminate session
END
ELSE
eat card
END
ELSE
message
END
Okay, just one ELSE IF; not much opportunity for that. |
|