#I want to write something so that the methods withdraw, deposit, and borrow can be used

1 messages · Page 1 of 1 (latest)

winter muskBOT
#

This post has been reserved for your question.

Hey @formal hedge! Please use /close or the Close Post button 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.

keen ferry
#

I do not understand your question

#

do you want to use the methods on the mybankaccount?

formal hedge
#

@keen ferry i want to use main method to call the other methods deposit, withdraw and borrow.

tough lotus
#

There's several issues with your code:

  1. You're expecting the name to be an int.
  2. 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.
  3. The constructor doesn't take parameters, but in main, you expect it to.
  4. Finally, you'll still have to call withdraw/deposit/borrow...
winter muskBOT
#

💤 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.