Answer:
maxWithdraw = 500; //Initialise maximum withdrawal amount
Charges = 0; // Initialise Charges
Input Amount; //Customer input amount to withdraw
Get AvailableAmount; // System reads customer available amount
if (Amount >= 300)
{
Charges = (Amount -300) * 0.04; //Calculate charges when amount to withdraw is greater than or equal to 300
}
if (AvailableAmount <= 0)
{
Amount = 0; //Initialise amount to 0 if customer balance is less than or equal to 0
}
if (AvailableAmount < Amount) {
Print “You do not have sufficient funds";
Charges = 25;
}
if (Amount > 500) {
Print "Maximum withdrawal amount is $500"
}
if (Charges > 0) {
AvailableAmount -= Amount;
AvailableAmount-= Charges);
}
if (Charges = 0) {
AvailableAmount -= Amount; }
Dispense Cash.