how to make attempts in pin numbers

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Oct 2008
Posts: 37
Reputation: l_03 has a little shameless behaviour in the past 
Solved Threads: 0
l_03 l_03 is offline Offline
Light Poster

how to make attempts in pin numbers

 
0
  #1
Nov 29th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,212
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 489
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: how to make attempts in pin numbers

 
0
  #2
Nov 29th, 2008
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?
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC