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
So first of all the user is met with a mini menu screen
1) Create new account
if he presses 2 and no account has been created, it tells him there is no account created then takes him to the create new account area of the program
if he presses 1 it takes him to this:
enter first name
enter last name
enter birth date (in correct format dd/mm/yyyy)
enter user name (only up to 9 characters)
repeat password (they must match)
then the computer generates an account number with the first two letters of the first name and the last two letters of the last name and 7 digits in between. (11 characters all together)
once an account has been created, the user can then go to login where they enter their username and password
and it obviously allows you to do those things and will reflect in the balance when you view it
Now this might seem very simple to a lot of you but I have never done anything on this scale, only simple invoicing programs for a hotel airline etc, and it wasn't even OOP it was one class and fairly simple.
what is the best way to approach this? is it complex enough to warrant diagrams and schematics etc?
I just want to tackle it one step at a time and get help till its finished and I can move onto another one.
I'm guessing the first thing I need to do is work out what classes I would need.
but I could do with suggestions.
as always thanks for reading and looking forward to your input
I think that you need to share more code, maybe you can simply design the classes and their instance variables (omit setter/getters) and share them with us ?
Just stating the names of the class you are thinking is not clear with your intent.
You can also include at least the method names that show the various activities you plan to support in your application.
You may also want a utility class for Scanner (or whatever way you get input from the keyboard). And if you really wanted to be OO about it, you could develop a UserInterface class that (in this case) prints to the screen.
All things are lawful, but not all things are profitable.
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.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here