Answer:
class CheckingAccount
{
// instance variables
String accountNumber;
String accountHolder;
int balance;
//constructors
. . . .
// methods
. . . .
void processDeposit ( int amount )
{
balance = balance + amount ;
}
}
Method to Process Checks
If you have the previous test program in a file,
it would be nice to add the processDeposit() method
and test it.
The method to process a check is slightly more complicated:
- Assume that the amount of a check is a positive value, expressed in cents.
- If the current balance is less than $1000.00, there is a $0.15 processing charge.
- The amount of the check and the processing charge (if any) are subtracted from the balance.
- The return type is
void.
Here is a sketch of the method:
QUESTION 15:
Fill in the blanks to complete the method.