Think of three behaviors a checking account should have.

A good answer might be:

The following seem reasonable to me:

  • Accept a deposit.
  • Process a check.
  • Get the current balance.
Several other behaviors could be added, but these will be enough for a simple example.

Requirements for Behavior

We will also need a constructor to create objects from the class, so we need to decide what the constructor should do. It seems reasonable that the constructor should create a new checking account and initialize it with the account number, the account holder's name, and starting balance.

So now we have a fair idea about what this class will look 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.

In a more complicated program, creating the specifications is very hard because objects of the new class will interact with perhaps hundreds of other objects. In this example program, the objects interacts only with the class that contains main().

QUESTION 4:

Is there enough information to start writting the program?

Click Here after you have answered the question