In the file Bankaccount.java, build a class called BankAccount that manages checking and savings accounts. The class has
Posted: Thu Jul 14, 2022 2:19 pm
In the file Bankaccount.java, build a class called BankAccount that manages checking and savings accounts. The class has three private: member fields: a customer name (String), the customer's savings account balance (double), and the customer's checking account balance (double). implement the following Constructor and instance methods as listed below: - public BankAccount(String newName, double amt1, double amt2) - set the customer name to parameter newName, set the checking account balance to parameter amt1 and set the savings account balance to parameter amt2. (amt stands for amount) - public void setName(String newName) - set the customer name - public String getName0 - return the customer name - public void setChecking(double amt) - set the checking account balance to parameter amt - public double getchecking0 - return the checking account balance - public void setSavings(double amt) - set the savings account balance to parameter amt - public double getSavings0 - return the savings account balance - public void depositChecking(double amt) - add parameter amt to the checking account balance (only if positive) - public void depositSavings(double amt) - add parameter amt to the savings account balance (only if positive) - public void withdrawChecking(double amt) - subtract parameter amt from the checking account balance (only if positive) - public void withdrawSavings(double amt) - subtract parameter amt from the savings account balance (only if positive) - public void transferToSavings(double amt) - subtract parameter amt from the checking account balance and add to the savings account balance (only if positive)