So I have a question about using methods.
Alright, let say I want to create a system of atm and bank. I create a class account that has all related attributes such as acc # and balance and blah. Then I create an ATM class that contain methods such as deposit and withdraw. In my main class, I create a customer object that belong to account class, but how do I use the methods from ATM class using the customer object?
RozenKristal
0
Newbie Poster
Recommended Answers
Jump to PostAt some stage you will need to tell the ATM which customer/account it is dealing with. You could just add that as a parameter to the deposit & withdraw methods.
OR if one customer is likely to do a load of transactions you could have a logon method in ATM …
All 2 Replies
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
RozenKristal
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.