#I want to write something so that the methods withdraw, deposit, and borrow can be used
1 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @formal hedge! Please use
/closeor theClose Postbutton above when you're finished. 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.
I do not understand your question
do you want to use the methods on the mybankaccount?
@keen ferry i want to use main method to call the other methods deposit, withdraw and borrow.
There's several issues with your code:
- You're expecting the name to be an
int. - The constructor doesn't actually store the variables, as they are only local scope (will be deleted after the constructor exits) - they have to be moved to the class body instead.
- The constructor doesn't take parameters, but in
main, you expect it to. - Finally, you'll still have to call
withdraw/deposit/borrow...
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.