Google Answers Logo
View Question
 
Q: Simple Java Debugging Needed... ( No Answer,   0 Comments )
Question  
Subject: Simple Java Debugging Needed...
Category: Computers > Programming
Asked by: wahooka-ga
List Price: $15.00
Posted: 26 Feb 2003 21:17 PST
Expires: 28 Feb 2003 02:52 PST
Question ID: 167718
I have been staring at my code for too many hours and I can't figure
out this last problem with my code. It's an ATM Simulation consisting
of a Client and Server. The source code is availible here:
http://www.hiddentreasurehosting.com/sourcecode/index.html

Just compile it and it will run fine. Make sure you start the Server
first.
You can use javac to compile and then java to run them. Use "java
Server" and "java Application" in that order to get it running.

Now to see the problem it's having, use some of the PIN's hard-coded
in the Bank.java. As you can see, each PIN is associated with an ID.
Once the PIN is validated, the next step is using that ID with the
SetAccount function in the CustomerAccount.java. This uses the ID to
set the values of the account, ie what accounts exist and what
balances are.

Everything seems to be working fine, but there is a bug somewhere.
You'll notice the first PIN, 1234 works perfect. If you try to access
an account that doesn't exist, it says an Error message "No existing
account". But if you use a different PIN, 7777 or the other one 5555,
and try to access an account that shouldn't exist for example PIN 7777
and PIN 5555 shouldn't have moneymarket accounts. But if you try to
access them in the Client program GUI, it doesn't display any error
that no account exists, like it does for the first PIN, 1234.

Once playing around with the program it will be very easy for you to
see what I mean. I'm sure this isn't too difficult of a program to
debug, but my eyes are hurting and I need this worked out ASAP.
Hopefully someone brillant can enlighten me sometime soon. ;) Thanks
for the help.

Request for Question Clarification by seizer-ga on 27 Feb 2003 03:44 PST
Your question is slightly unclear - are you sure that account 7777
does not display a money market error? On my system it says this for
account 7777 when I hit 3.

Bank has no record of a Money Market account. 
Please select a valid account.

Do you not see this message? Have you deleted all old .class files and
recompiled everything? What version of Java are you using?

Thanks,

--seizer-ga

Clarification of Question by wahooka-ga on 27 Feb 2003 04:54 PST
Yes, I see what you mean. But I deleted my old .class files and the
program seemed to work the first time around. But there is still a
problem. Once you reach the end of your transaction, you have an
option to do another tranasaction, or esstienally logout.

If you choose logout, and re-enter a different pin, then you will get
the error I have described. So the problem still does exist. Thanks
for the suggestion.

Request for Question Clarification by aardvark-ga on 27 Feb 2003 13:27 PST
Everything seems to work perfectly for me as well.  Could you post the
exact steps you used to create the error condition.

Clarification of Question by wahooka-ga on 27 Feb 2003 17:23 PST
It seems as thought I had accidently had one wrong file compiling in
the same directory. So it does work, thanks alot for helping me find
my problem though.

Another problem I'm having is with adding multi-threading to the atm
client/server. Instead of my answer money going toward the previous
question, someone who can help me figure out how to implement
multi-threading will get the money. I also added a little bit more to
it to make it worth while. I need multi-threading to enable up to 10
clients to connect to the server at the same time, otherwise
displaying a message that the user will have to wait for an open slot,
or cancel everything and not wait.

Same code as the above example. Fast answer will result in a nice tip.
As always, thanks for the help!
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy