else 4 if else
else
if case if
case if else
Pascal
Pascal if case
case Qty of
0..10: Discount := 0. 0
1 1..100 Discount := 0. 025
101..1000: Discount := 0. 05
else Discount := 0. 10;
end; case
if-then-else
C
while! feof TransFile
* read transaction record *
ReadTransRec TransFile TransRec
* process transaction depending on type of transaction *
if TransRec.TransType = = Deposit
{
* process a deposit *
if TransRec.AccountType = = Checking
if TransRec.AcctSubType Business
MakeBusinessCheckDep TransRec.AcctNum , TransRec.Amount ;
else If TransRec.AcctSubType = = personal
MakePersonalCheckDep( TransRec.AccNum,TransRec.Amount );
else if TransRec. AcctSubType School
MakeSchoolCheckDep TransRec.AcctNum TransRec.Amount ;
else if (TransRec.AccountType = = Savings )