warren brandt wrote:i have come up with a small project for myself (though i'm sure its been done before)
I want to develop an ATM machine application...
Well, you've
definitely got the first step right: You
haven't started coding. Well done!
And I mean that quite seriously.
You've managed what maybe 5% of beginners can - explain to a bunch of old farts like us (very well, I might add),
what you want to do, without using a line of
Java code to do it.
And THAT suggests to me that you're going to be a good programmer.
Everything that you've described so far could be done in a dozen computer languages, and that's good design.
But now you want to get down to the nitty-gritty. In
Java.
My suggestion #1: Start with creating a new user account, and for the moment forget everything else. No point in logging in a user until they exist, right?
As for your classes: Instead of UserAccount, BankAccount, and MainProgram, what about
User (or Customer),
Account, and
ATM?
Same basic idea, but maybe a bit more focused:
A
User holds information for a user: Name, address, dob, password (or - usually better - its encryption), etc.
An
Account holds financial information about a specific User: Account #, current balance, overdraft limit...
And the
ATM - which will probably end up being your "main" program - holds all the stuff that an ATM needs to know about - Accounts, Users, and the like - and goes though its cycle once for each
User who sticks a card in the slot.
I suspect you'll find you need a few more classes, but the ones you've got are fine to start with.
But stick to
one thing at a time.
Get that Create User function working, and don't even think about logging them in until you have it working Every.Single.Time, no matter how bad the input is.
Then, once you can create a
User and log 'em in, maybe create an
Account for them.
Then, when (and
only when) you can do all that, worry about that second menu.
Don't get me wrong. It's great that you have a plan of what you want to do; but don't get too far ahead of yourself, because aspects might change, or you might work out a better strategy, and you don't want to tie yourself down too much.
Hope it helps. and again: Well done so far.
Winston