#I have a question that I don't understand so I can't answer it.

11 messages · Page 1 of 1 (latest)

prime arch
#

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?

foggy salmonBOT
#

This post has been reserved for your question.

Hey @prime arch! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

sullen plaza
#

are you sure that's what the task says

prime arch
#

yeah why, is it impossible?

#

I mean by what it says

sullen plaza
#

somewhere

#

so i would assume they wrote that somewhere

prime arch
#

ok I think I might be mistaken here cuz the info says that the class should have these attributes and methods but it doesn't specifically say that Im not allowed to add more. It just says that it should have them in. The way I saw it is that it saying that the class should consist of something I thought it meant it would be only that specifically

#

kind of wasted your time here sorry