Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 tStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started