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 (countExplanation / 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.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.