Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

What is the balance of b after the following operations? Why? SavingsAccount b =

ID: 3814222 • Letter: W

Question

What is the balance of b after the following operations? Why?

SavingsAccount b = new SavingsAccount (10);

b.deposit (5000);

b.withdraw (b.getBalance () / 2);

b.addInterest ();

because Questions 3 and 4 refer to the ArrayList friends as declared below sub Class. another more toen a mon ey AmayList friends. new ArrayList (l friends add (Mary I; e al r Aston, Soa friends add ames k friends add ("Kevin I; friends add IL Tanya Consider the method search defined beloa pubic stati int search (string key, ArrayList String temp (String) lagetl while (count

Explanation / Answer

given question is:-

SavingsAccount b = new SavingsAccount (10);

b.deposit (5000);

b.withdraw (b.getBalance () / 2);

b.addInterest ();

-----------

initially when

SavingsAccount b = new SavingsAccount (10);

//** here balance is initially zero

now in next code

b.deposit (5000);

//** here balance value becomes 5000

b.withdraw (b.getBalance () / 2);

//** here balance =5000/2,which is equal to 2500,since half of the deposited amout in withdrawn,therefore we are left with only 2500,so now the further process wiill carry using 2500.

b.addInterest ();

//**here after adding interest,the balance value becomes 2750,this interest is from the 10%of 2500=250

no when we add 2500+250=2750

so the final value of b=2750.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote