943,772 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 374
  • Java RSS
Nov 29th, 2008
0

how to make attempts in pin numbers

Expand Post »
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.");

}

Last edited by l_03; Nov 29th, 2008 at 2:31 pm.
Reputation Points: 5
Solved Threads: 0
Light Poster
l_03 is offline Offline
37 posts
since Oct 2008
Nov 29th, 2008
0

Re: how to make attempts in pin numbers

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?
Moderator
Featured Poster
Reputation Points: 2786
Solved Threads: 871
Code tags enforcer
peter_budo is offline Offline
6,656 posts
since Dec 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Paint EVERY rectangle drawn on a canvas using vector
Next Thread in Java Forum Timeline: JTable





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC