Exercise : BankAccount transactionFee
-
Add a
double
field to the BankAccount
class named transactionFee
that represents an amount of money to deduct every time the user withdraws money.
The default value is $0.00
, but the client can change the value.
Deduct the transaction fee money during every withdraw
call (but not from deposits).
-
Make sure that the balance cannot go negative during a withdrawal.
If the withdrawal (amount plus transaction fee) would cause it to become negative, don't modify the
balance
value at all.
-
Test your solution to this problem in Practice-It.