This is a study question similar to the one that i will need to be
ready to answer.
**********************
You are currently working for a company that is going to produce
ATMs. Please create a program, using at least two different classes,
that does the following:
·The program should ask the user to input their account number,
username, and password.
·The program should ask the user to input their initial balance (I
know this is a little weird, but since we cant retrieve this we have
to enter it)
·The program allows the user to deposit or withdraw money from their
account.
·Accounts cannot have a balance of under $50.
·For every transaction the system should print:
Initial Balance
Amount withdrawn or deposited
Current Balance
*********very important!!!***************
The code cannot have any short-cuts like "gpa>=0? (""+gpa):" OR
"gpa=-1; //for unknown GPA"
ALSO no fancy stuff like keyword "this" because we have not used it
yet. Just very plane-jane code. |
Request for Question Clarification by
rbnn-ga
on
04 Nov 2002 13:56 PST
Should the Atm class hold a list of all its users and their passwords,
and check that the passwords are correct? Or does it just work for one
user?
|
Clarification of Question by
brittlehorse-ga
on
04 Nov 2002 13:58 PST
Not hold a list of the users. Too complicated. Just check to see if
the password is correct, but i would take just about anything right
now. Speed is of the essence my friend.
ps glad your answering this for me.
|
Request for Question Clarification by
rbnn-ga
on
04 Nov 2002 14:06 PST
I still don't understand how to check that the password is correct
unless we have a list of users here. Are you saying the Bank only has
one user?
I could just have the Bank class do something like
String[]usernames
String[]passwords
double[] balances
and when a username/password pair comes in, it could check for that .
But this would require constructs like arrays and for loops, and some
if statements here. is that ok?
|
Request for Question Clarification by
rbnn-ga
on
04 Nov 2002 14:10 PST
Another thing I do not understand here is this.
You say the user input his own initial balance because we cannot
retrieve it.
But if we cannot retrieve the balance, then how can we retrieve the
password to check it is right?
Perhaps if you typed in what you would like the output of the program
to look like a bit.
|
Clarification of Question by
brittlehorse-ga
on
04 Nov 2002 14:11 PST
i would say that the bank has only one user. I did like the level of
code you just displayed. I think it's a go. I can use some simple
loops however. Like do while and for. You got it bro.
|
Clarification of Question by
brittlehorse-ga
on
04 Nov 2002 14:20 PST
the user just inputs the beginning balance and then it is used in the
rest of the program. The only reason this is weird is because you
can't just tell an ATM how much you have, but in this case you do.
ATM:
what is:
your name
your acctNumber
your Password
User:
my acctNumber is:
my name is:
my beginning balance is:___
deposit()
widthdraw()
******
i think that is it.
|
Request for Question Clarification by
rbnn-ga
on
04 Nov 2002 14:28 PST
I appreciate your attempts to clarify what is going on here, but try
as I might I just cannot figure out what is required.
For instance, I don't understand what the password is to be validated
against; I don't understand what it means for a bank to have one user,
I'm just not clear on this.
You might try as I mentioned, typing out what the program should *do*,
perhaps?
Actually if there are other researchers who feel they can tackle this
please feel free to help out here!
|
Request for Question Clarification by
rbnn-ga
on
04 Nov 2002 14:29 PST
I just saw your sample output. OK, I will try to post something along these lines.
|
Clarification of Question by
brittlehorse-ga
on
04 Nov 2002 14:38 PST
I guess the bank could store more than one user if makes it easier.
I'll take your best stab at it and be VERY happy. Speed is more
important than accuracy at this point.
The program should:
Have Two classes
Keep track of a verified users account balance
Let them deposit and withdraw.
Make it look like an idiot did it
Get done fast (yup)
|