Consistent Application of a Rule

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:

I don't remember that.

Consistent Application of a Rule

Actually, the amount is $1000. Luckily, that "rule" is programmed into to the processCheck() access method. By using the access method, the rule is correctly applied, regardless of your poor memory:

bobsAccount.processCheck( 1400 );  // correctly applies the rule

jillsAccount.processCheck( 4500 ); // correctly applies the rule

If there is a bug in the application of the rule, there is only one place to look for the problem: in the access method.

QUESTION 6:

Another bank charges 10 cents per check for accounts with a balance of more that $500. Our bank needs to do the same in order to keep its customers. How hard will it be to make that change?