A good answer might be:
| |
Testing the MethodWhen the currentBalance() method is added, the program can be run and tested. It is a good idea to alternate between writing and testing like this. By testing each part as it is added you catch problems early on, before they can cause further problems. Of course, it helps to have a good initial design. This is how houses are built, after all: starting with a good design, the foundation is laid, and structures are built and tested until the house is finished. Here is a compilable and runnable test program:
This test program creates two objects, account1 and account2 of type CheckingAccount. | |
QUESTION 12:What will the program output when run? (Sketch out the answer, don't worry about spaces.) Click Here after you have answered the question |