// Una SavingsAccount hereda lo de BankAccount, agrega applyInterest y
// hace override de withdraw y toString.
public class AccountDemo {
    public static void main(String[] args) {
        BankAccount plain = new BankAccount("C-001");
        plain.deposit(50_000);
        IO.println(plain);

        SavingsAccount savings = new SavingsAccount("A-001", 2);
        savings.deposit(100_000);           // heredado de BankAccount
        savings.applyInterest();            // propio de SavingsAccount
        IO.println(savings);                // override de toString

        for (int i = 1; i <= 4; i++) {      // override de withdraw
            IO.println("retiro " + i + ": " + savings.withdraw(1_000));
        }
        IO.println("saldo final: " + savings.balance());
    }
}
