This is Exercise 8.12 and 8.13, BankAccount, on p. 568 of your textbookIn addition to the
This is Exercise 8.12 and 8.13, BankAccount, on p. 568 of your textbookIn addition to the
“BankAccount.java” file, you must also write a client program to use the BankAccount class. Please name the file containing the client program “BankAccountMain.java”. Zip up both files into “BankAccount.zip” and submit the zip file to Canvas.
Hints: I recommend supplying a constructor method which fills in the “String name” field in addition to the “toString()” method. Also, the client program should use the “deposit()” method to deposit some money so that your printed output will be meaningful.
Finally, note the “transactionFee” field described in 8.11.
All of the usual requirements as to functionality, programming style and interface also apply.
(12) Add a toString method to the BankAccount class from the previous exercise. Your method should return a string that contains the account’s name and balance separated by a comma and a space. For example, if an account object named yana has the name “Yana” and a balance of 3.03, the call yana.toString() should return the string “Yana, $3.03”.
(11) // Each BankAccount object represents one user’s account
// information including name and balance of money.
public class BankAccount {
String name;
double balance;
public void deposit( double amount ) {
balance = balance + amount;
}
public void withdraw( double amount ) {
balance = balance – amount;
}
}
help me plz!
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"
