Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Help > Automated telle...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 16022 of 16192
Post > Topic >>

Automated teller machine help please

by Totti <saliba.toufic.george@[EMAIL PROTECTED] > Apr 25, 2008 at 03:53 AM

Hi all,
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, a
client,
a server and an application. the program contains 2 bugs that i
woud like you to help me solve them

1- the program take random choice for working or not which is too
weird to me (i m a beginer)
the program may work for one time properly, then not then yes,
eventhough i compile everytime.
eventhough i know that this is not something possible in programming
terms, but indeed it is highly possible to compile, try to run and it
breaks and after 1 minute, compile again and run nicely

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
name . Instead, in case the pass i give is the right one, i go to the
next step
which is "main menu", what i want is to go step by step the
procedure,
like if anything except the UserName was given even a right pass. the
program shall not take it, it should remain in the UserName step
untill entered correctly


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
on
both sides and if you can, please help!

Fom the client side:
                modifiedsentence =3D inFromServer.readLine();
                String onoma =3D "MyBank";
                String onoma1 =3D "MyName";
                String Pass =3D "MyPass";

                if (modifiedsentence.equalsIgnoreCase(onoma))
                {
                        System.out.println("Enter your User Name");
                }
                if (modifiedsentence.equalsIgnoreCase(onoma1))
                {
                        System.out.println("Enter your Password");
                }
                if (modifiedsentence.equalsIgnoreCase(Pass))
                {
                        System.out.println(" ");
                        System.out.println("MAIN MENU");
                        System.out.println("---------");
                        System.out.println("* w for Withdrawal");
                        System.out.println("* d for Deposit");
                        System.out.println("* c for check Balance");

// here the program wil run the third file or the application file
}
---------------------------------------------------------------------------=
=AD---------------------------------------
=46rom the server side:
                clientsentence =3D inFromClient.readLine();
                //Ask for a cardNumber
                Accepted =3D clientsentence.toUpperCase() +"\n";
                NotAccepted =3D clientsentence.toUpperCase() +" is NOT
accepted "+
"\n";
                String Nom =3D "MyBank";
                String PreNom =3D "MyName";
                String PassWord =3D "MyPass";

                if (clientsentence.equalsIgnoreCase(Nom))
                {
                        outToClient.writeBytes(Accepted);
                }
                if (clientsentence.equalsIgnoreCase(PreNom))
                {
                        outToClient.writeBytes(Accepted);
                }
                if (clientsentence.equalsIgnoreCase(PassWord))
                {
                        outToClient.writeBytes(Accepted);
                }
                else
                {
                outToClient.writeBytes(NotAccepted);
                }
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D
i m pretty sure the problem is here 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

Thank you all
 




 2 Posts in Topic:
Automated teller machine help please
Totti <saliba.toufic.g  2008-04-25 03:53:44 
Re: Automated teller machine help please
RedGrittyBrick <RedGri  2008-04-25 14:40:27 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 5 15:09:38 CDT 2008.