Flowchart

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.
go to previous page   go to home page   go to next page

Answer:

The program tries out various interest rates starting at zero percent. For each interest rate, the amount of dollars must be reset back to the amount in the account at the beginning of the first year.

Flowchart

Here is a flowchart that shows the logic of the program. Observe how one loop is nested inside of another. Notice how dollars is initialized to initialAmount each time the inner loop is started.

nested loop

Look in the flowchart (or program) at how rate is adjusted to the new rate at the top of the loop body of the outer loop.

QUESTION 12:

Is rate adjusted at the correct spots in the program?