The question is asking me to make a class called PensionAccount. In the class there should only be 2 attributes called interestRate and withdrawlAmount. The "behaviour(s)" of the class should be getBalance and addInterest.
The descriptions for the "behaviour(s)" are the following:
getBalance
This method should take no arguments and return the balance. It is required because balance
will not be accessible directly.
addInterest
This method should compute and add the interest to the account using its interest rate. It
takes no arguments and returns nothing.
Ive uploaded what I've done as a picture but I can't use balance since it's not an attribute to the class but also how do I "compute and add the interest to the account" if not adding to the balance. If not the balnace I'd have to make another attribute but that's not allowed.
What do I do?