can someone help me how to make attempts in pin numbers...for like example,,if the user input three times of a wrong pin number,,then the program will exit..help me..this is not really my whole code...

if (pinNum2== bank.arrAccount[2][0][0]){

                            String w = JOptionPane.showInputDialog("How much you want to withdraw?");
                            int withdrawAmount =Integer.parseInt(w);
                            bank.withdrawCash(withdrawAmount);
                            continue mainLoop;

                        }

                        else {

                            JOptionPane.showMessageDialog(null, "Attemp1.");

                        }

Some where on the start of your code declare counter and then you should use it inside your else statement (with message dialog). Also else statement should contain sub statement and this will close down application once entered pin was wrong 3 times in succession

PS:Would be about time you start using code tags you been already warned about it!

[code] YOUR CODE HERE [/code]
Is this so difficult?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.