Skip to contents

Removes a specified amount from the account balance, with validation to prevent overdrafts (unless overridden in subclasses).

Usage

withdraw(x, ...)

Arguments

x

A BankAccount object or its subclass.

...

Additional arguments passed to methods.

Value

The modified account object (invisibly).

Examples

account <- BankAccount("ACC123", "John Doe", 1000)
withdraw(account, 300)
#> Withdrew $300.00. New balance: $700.00