A good answer might be:

100
585

(Remember to subtract the 15 cent service charge.)

Scaffolding

class CheckingAccount
{
  // instance variables
  String accountNumber;
  String accountHolder;
  int    balance;

  //constructors
  . . . .

  // methods
  . . . .

  void display()
  {
    System.out.println( _____________________ );
  }
}

If this class were to be used in an actual bank, it would need a great deal more testing. Usually testing involves placing statements that write out information to the terminal as the program is being run. Thoughtful placement of these statements can greatly ease software development. These statements (and other statements intended to be used for testing and program development) are sometimes called scaffolding. They are put in place as the program is being written and tested, and are removed when testing is finished. This is similar to the scaffolding used when a building is being constructed. Well-placed scaffolding greatly aids the carpenters, roofers, painters and other trades that work on the building. Programmers should do the same for themselves.


The statements that write out the state of a CheckingAccount object are somewhat awkward:

System.out.println( account1.accountNumber + " " +
    account1.accountHolder + " " + account1.currentBalance() );

It would aid in testing if a CheckingAccount itself could be asked to do this. This is a display method which can be added to the class, as seen above.

QUESTION 17:

Complete the display() method.