|
Is there enough information to start writting the program? A good answer might be:Probably not. It has not been specified how deposits and checks will be processed. | ||||||||||||
More RequirementsThe requirements describe what each method does. The method to accept a deposit will add an amount (in pennies) to the current balance. The current balance can be negative or positive. The method to process a check subtracts the amount of the check from the current balance. Overdrafts are allowed, so the balance can become negative. However, if the balance is less than $1000.00 before the check is processed, $0.15 is charged for each check. To simplify the program, assume that all input data is correct (so the methods do not check for errors.) It is time to think about design. The first thing to do is sketch out what the class definition looks like as Java code:
The instance variables is where the variable declarations will go.
| ||||||||||||
QUESTION 5:Think of a reasonable variable name (identifier) and data type for each of the three values of a checking account:
|