| | |
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
Views: 258 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for Java
account android api apple applet application arguments array arrays automation binary bluetooth calculator chat class classes client code component data database draw eclipse error errors event exception file filechooser fractal game givemetehcodez google graphics gui helpwithhomework homework html ide image inheritance input integer j2me java javaprojects jlabel jmf jni jpanel jtextfield julia linux list loop map method methods midlethttpconnection mobile monitoring netbeans newbie nullpointerexception number object open-source oracle print problem program programming project property recursion ria scanner screen search server set size sms socket sort sourcelabs splash sql sqlite static string support swing test testautomation threads time transfer tree windows






