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

The solution works, but the iteration keeps looping to month 1 within the for lo

ID: 3533663 • Letter: T

Question

The solution works, but the iteration keeps looping to month 1 within the for loop. I need to find out how to get the following Output: Enter the savings account's balance: 10000 Enter the savings account's annual interest rate: .02 How many months have passed since the account was opened? 3 Enter the amount deposited during month 1: 1200 Enter the amount withdrawn during month 1: 900 Enter the amount deposited during month 2: 1500 Enter the amount withdrawn during month 2: 1100 Enter the amount deposited during month 3: 2000 Enter the amount withdrawn during month 3: 1800 Total Deposited: $4,700.00 Total withdrawn: $3,800.00 Interest Earned: $53.25 Ending Balance: $10,953.25 What I need help with is having the program iterate 3 times because the user entered 3 for how many months the account has been opened. And the set precision for dollar amounts. This is an intro to Java class so simple code is needed here, I wouldn't understand any advanced code. Thank You!

Explanation / Answer

even i had this problem last year.... there is an error in that solution given... the variable incremented in the for loop is decremented inside the code block which the loop executed... all you have to do is remove that statement... sry i dnt remember the exact line to be removed

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