go to previous page   go to home page   go to next page

Answer:

Yes.


Method Definition

Now that we have a test program, we can add methods to the class one-by-one, testing each method as it is added. Recall the three methods from the requirements:

Remember the syntax for method definition:

returnType methodName ( parameterList )
{
  statementList
}

Think about a method that will return the current balance. When it is called, it will not alter any data in a checking account object, but will merely return the current balance.


QUESTION 12:

What is the first line of the current balance method? The method will not use any parameters. Think of a name for the method.


go to previous page   go to home page   go to next page