| | |
how to make attempts in pin numbers
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Oct 2008
Posts: 37
Reputation:
Solved Threads: 0
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.");
}
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.
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?
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
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
![]() |
Other Threads in the Java Forum
- Previous Thread: Paint EVERY rectangle drawn on a canvas using vector
- Next Thread: JTable
| Thread Tools | Search this Thread |
-xlint android api applet application array arrays automation bi binary blackberry block bluetooth chat class classes client code compile compiler component database developmenthelp draw eclipse error event exception fractal freeze game gameprogramming givemetehcodez graphics gui html ide image input integer j2me j2seprojects java javac javaprojects jetbrains jni jpanel jtable julia learningresources lego linux list login loop loops mac map method methods mobile netbeans newbie notdisplaying number online oracle page print problem program programming project qt recursion scanner screen server set singleton size sms sort sql string swing system template textfields threads time title tree tutorial-sample update variablebinding windows working xor






