Question: What is wrong with this code, why did I not change the result when I run this code in main? How to correctly return the
What is wrong with this code, why did I not change the result when I run this code in main? How to correctly return the balance after deposit and withdrawal?


public void deposit (int acctId, double amount) Person temp -new Person (acctId): for (BasicAccount ac : accounts) if (ac null && temp. equals (ac. get0wner)) ac. deposit (amount) ; public void withdraw(int acctId, double amount) f Person temp -new Person (acctId): for (BasicAccount ac accounts) if (ac null && temp. equals (ac. get0wner)) ac. deposit (amount) ; public double deposit (double anount) t if (amount>0) balancebalance+amount return balance public double withdraw (double amount) if (amount balance) return balance; else t
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
