logo Practice-It logo


Language/Type: Java classes fields instance methods
Author: Marty Stepp (on 2010/05/23)

Consider the class BankAccount defined below. Each BankAccount object is supposed to represent one investor's bank account information including their name and their money balance. Make the following changes to the class:

  • Add a double field 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.
  • Make sure that the balance cannot go negative during a withdrawal. If the withdrawal would cause it to become negative, don't modify the balance value at all.
Type your solution here:

This is a class problem. Submit a complete Java class as described.

You must log in before you can solve this problem.

Log In

If you do not understand how to solve a problem or why your solution doesn't work, please contact your TA or instructor.
If something seems wrong with the site (errors, slow performance, incorrect problems/tests, etc.), please

Is there a problem? Contact a site administrator.