Question
Example Output:
Doe, John, Checking Account Balance: $123.45, Savings Account Balance: $245.33
Smith, Karen, Checking Account Balance: $213.65, Savings Account Balance: $545.78
Bing, Charlie, Checking Account Balance: $913.65, Savings Account Balance: $10,456.54
Chow, Lee, Checking Account Balance: $1913.65, Savings Account Balance: $4,456.99
Mustaham, Kadhar, Checking Account Balance: $999.65, Savings Account Balance: $3,456.87
Calculate and display the total Check Account Balance & Savings Account Balance for all of your accounts using a running grand total.
Also, write a method to simulate a debit & credit to your simulated Banking program.
Solution Preview
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.
public class Account implements AccountInterface{protected double balance;
protected double floor ;
public Account() {
balance = 0.0;
floor = 0.0;
}
public Account(double balance, double floor) {
this.balance = balance;
this.floor = floor;
}
public double getBalance() {
return balance;
}
public void setBalance(double balance) {
this.balance = balance;
}
@Override
public boolean debit(double amount) {
double temp = balance - amount;
if (temp < floor) {
return false;
} else {
balance = temp;
return true;
}
}...