> Hi all,
Please read all of
http://www.catb.org/~esr/faqs/smart-questions.html
I think you may find it helpful.
> i m trying to make a program (client/server) of a Automated teller
> machine talking with its bank server. i did it using 3 files,
I think you mean three classes, maybe you mean three programs.
> a client, a server and an application.
A program is an application, I find your description confusing.
> the program contains 2 bugs that i
> woud like you to help me solve them
[quoted text clipped - 6 lines]
> terms, but indeed it is highly possible to compile, try to run and it
> breaks and after 1 minute, compile again and run nicely
It sounds like a timing issue. Maybe you are trying to use some resource
before it is ready, sometimes you are lucky and it is ready in time.
Don't forget your computer is doing other tasks in the background so
these may have small but significant effects on the timing of various
events in your application.
> 2- whenever i enter a right value, i go to the right step if i enter
> the password before the username it will not prompt me about a user
[quoted text clipped - 5 lines]
> program shall not take it, it should remain in the UserName step
> untill entered correctly
You don't provide enough code for me to see where your problem lies. I
suggest you write a separate small programs whose job is to prompt the
user for those things in the order you want them. If it works, apply
what you learned to your ATM program. If it doesn't work post it here
and say what it actually does and what you expected it to do.
http://sscce.org/
> for this, i suppose the problem is in the IF statements but i m not
> sure how to fix them so i will show you what are the 'IF' i m using
[quoted text clipped - 6 lines]
> String onoma1 = "MyName";
> String Pass = "MyPass";
Your variable names are uninformative, this makes the program harder to
read.
> if (modifiedsentence.equalsIgnoreCase(onoma))
> {
[quoted text clipped - 26 lines]
> String PreNom = "MyName";
> String PassWord = "MyPass";
These variable names are inconsistent with those used in the client.
A well-established Java convention is that variable names start with
lower case letters. Your variable names look like class names. This
makes your code harder to read and understand.
> if (clientsentence.equalsIgnoreCase(Nom))
> {
[quoted text clipped - 14 lines]
> ==========================================================
> i m pretty sure the problem is here
I'm not.
> so i must nest 'IF' in some way
> or
> something else should be done, like making a separate readline for
> each new line entered by the ATM user, i really dont know what to do
> from here on, would you please help
You need to wrap those If statements in some sort of loop that continues
prompting until all inputs are complete.
Nesting the If statements may help. I'd avoid them by having the client
encode the keywords as a data type that can be used in a switch
statement. You haven't described what the client passes to the server
and it's not clear to me from your code.

Signature
RGB