Jump to content

For anyone having difficulties understanding functions methods and why youre using parameters a...


G+_Dean T
 Share

Recommended Posts

For anyone having difficulties understanding functions / methods and why youre using parameters and why they sometimes do and do not return something I have quickly put together a simple program that emulates a bank account using 3 very simple functions and have tried to be very descriptive in the comments. Its rushed together as it was just an idea I got while reading a c# book so expect spelling mistakes but thought it could be useful to someone since its very simple but has a practical use.

 

http://pastebin.com/Fw89GKBL

http://pastebin.com/Fw89GKBL

Link to comment
Share on other sites

Joe Maruschek I think thats great! Its why I love this community and I share my code hoping someone will take it and play around with it. It also helps me learn as I see new things this way. Speaking of which this is the first time I have noticed methods being inside a class. Other than the constructor which i knew about due to a previous post on my code and I used in my codemart program, I know nothing of writing the method in the class. Any chance you could elaborate on the reason / benefits / uses of this? One other question is on this line

!acct.Withdraw(withdrawAmnt)

Is this anything like a less that statement?

Hope Im not asking too much just curious and hungry to learn.

Link to comment
Share on other sites

 Share

×
×
  • Create New...