Requirements for Behavior

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 following seem reasonable to me:

  • Accept a deposit
  • Process a check
  • Get the current balance

You might have thought of others, but the above will be enough for now.

Requirements for Behavior

The constructor creates a new checking account and initializes it with its account number, the account holder's name, and the starting balance. Now we have a fair idea about what the class looks like:

  • Data
    • Account number
    • Name of account holder
    • Current balance
  • Constructor
    • Create the object; initialize the three data items
  • Methods
    • Accept a deposit
    • Process a check
    • Get the current balance

For a large project, creating specifications is hard because objects interact with perhaps hundreds of other objects. In this example program, objects interact only with main().

QUESTION 4:

Is there enough information to start writing the program?