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?

What is wrong with this code, why did I not change theresult when I run this code in main? How to correctly return

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!