Question: ***Program should be in basic java. The problems refrenced to create this program are from Building Java Programs, 3rd edition. Chapter 8: Exercises #11, #12,
***Program should be in basic java. The problems refrenced to create this program are from Building Java Programs, 3rd edition.
Chapter 8: Exercises #11, #12, and #13, page 568 30 points You are to incorporate all requirements of the three exercises into the basic class definition provided in the Exercise #11 description. In addition, you must check the values of deposit, withdrawal, and transfer amounts to ensure they are greater than 0. For two of the three methods, deposit and withdraw, the methods are to return a booleanvalue to indicate if the transaction was completed. For method transfer, the method is to RETurn the allowed amount transferred, refer to Exercise #13 for details for a partial transfer. In addition to the specified class methods, provide a method name() that returns a String reference to the objects account name. To start this project, create an Eclipse project and copy the two supplied source code files, Project9_BankAccount.java and BankAccount.java into the projects src folder. File BankAccount.java has the class definition shown in the text as your starting point; note that methods deposit and withdraw are incomplete! You must define all required methods in this file. You should not modify the Project9_BankAccount.java file as it provides a means to test your code. I will utilize this same test program to verify the functionality of the BankAccount class source code file you submit. Your code must work as shown with my test program!
A sample Console output from this program is shown below. Code method toString() to produce the output shown for the class objects in the following Sample Console Output.
Project #8 Solution Chapter 8, Exercise #11, page 568
Example #1: Account object instantiated with name only
Beginning account:
John Doe, $0.00, Total fees: $0.00
Depositing: $51.75
John Doe, $51.75, Total fees: $0.00
Withdrawing: $7.96
John Doe, $43.79, Total fees: $0.00
Depositing: $14.78
John Doe, $58.57, Total fees: $0.00
Depositing: $-4.59
Unable to deposit $-4.59
Withdrawing: $45.79
John Doe, $12.78, Total fees: $0.00
Withdrawing: $-3.57
Unable to withdraw $-3.57
Withdrawing: $12.78
John Doe, $0.00, Total fees: $0.00
Withdrawing: $0.01
Unable to withdraw $0.01
Example #2: Account object instantiated with name and beginning balance: $23.67
Beginning account:
Sarah Jones, $23.67, Total fees: $0.00
Depositing: $51.75
Sarah Jones, $75.42, Total fees: $0.00
Withdrawing: $7.96
Sarah Jones, $67.46, Total fees: $0.00
Example #3: Account object instantiated with name, beginning balance: $34.57, and transaction fee: $2.50
Beginning account:
Samuel Johnson, $34.57, Total fees: $0.00
Depositing: $51.75
Samuel Johnson, $86.32, Total fees: $0.00
Withdrawing: $7.96
Samuel Johnson, $75.86, Total fees: $2.50
Withdrawing: $75.86
Unable to withdraw $75.86
Example #4: Transfers between two accounts
myAccount: Sarah Jones, $67.46, Total fees: $0.00
yourAccount: Samuel Johnson, $75.86, Total fees: $2.50
Transfering $41.38 from Sarah Jones's account to Samuel Johnson's account
Source Account: Sarah Jones, $21.08, Total fees: $5.00
Amount Transferred: 41.38
Destination Account: Samuel Johnson, $117.24, Total fees: $2.50
Transfering $-8.79 from Sarah Jones's account to Samuel Johnson's account
Unable to transfer $-8.79
Transfering $78.67 from Samuel Johnson's account to Sarah Jones's account
Source Account: Samuel Johnson, $33.57, Total fees: $7.50
Amount Transferred: 78.67
Destination Account: Sarah Jones, $99.75, Total fees: $5.00
Transfering $94.74 from Sarah Jones's account to Samuel Johnson's account
Source Account: Sarah Jones, $0.01, Total fees: $10.00
Amount Transferred: 94.74 Destination Account: Samuel Johnson, $128.31, Total fees: $7.50
Transfering $0.01 from Sarah Jones's account to Samuel Johnson's account
Unable to transfer $0.01
Transfering $150.0 from Samuel Johnson's account to Sarah Jones's account
Source Account: Samuel Johnson, $0.00, Total fees: $12.50
Amount Transferred: 123.31
Destination Account: Sarah Jones, $123.32, Total fees: $10.00
(spacing not completely accurate)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
