Question: Implement a class Portfolio. This class has two objects, checking and savings, of the type BankAccount that was developed in How To 8.1 (ch08/how_to_1/BankAccount. java
Implement a class Portfolio. This class has two objects, checking and savings, of the type BankAccount that was developed in How To 8.1 (ch08/how_to_1/BankAccount. java in the companion code for this book). Implement four methods:
• public void deposit(double amount, String account)
• public void withdraw(double amount, String account)
• public void transfer(double amount, String account)
• public double getBalance(String account)
Here the account string is "S" or "C". For the deposit or withdrawal, it indicates which account is affected. For a transfer, it indicates the account from which the money is taken; the money is automatically transferred to the other account.
Step by Step Solution
3.43 Rating (175 Votes )
There are 3 Steps involved in it
public class Portfolio private BankAccount checking private BankAccoun... View full answer
Get step-by-step solutions from verified subject matter experts
