[SOLVED] Random number is not working
Everytime I run this random 4 digit number and 8 digit number outputs as 0. If you could help me and point out what I am doing wrong thatwould be great. Thanks!:)
import javax.swing.JOptionPane;
public class generateAccountNumber{
public static void main(String[] args){
String bankId = "A4326";
String result = "";
final String BANK_ID = "A4326";
int[]randNums4 = new int[1000];
int[]randNums8 = new int[1000];
int i;
String firstName = JOptionPane.showInputDialog("First Name:");
firstName.toUpperCase();
String lastName = JOptionPane.showInputDialog("Last Name:");
lastName.toUpperCase();
for(i = 0;i<=randNums4.length && i>999;i++){
randNums4[i] = (int)(8999.0*Math.random()+1000);
System.out.println(randNums4[i]);
}
for(i = 0;i<=randNums8.length && i>9999999;i++){
randNums8[i] = (int)(89999999.0*Math.random()+10000000);
System.out.println(randNums8[i]);
}
result += BANK_ID+"-"+lastName.charAt(0)+firstName.charAt(0)+"-"+randNums4[i]+"-"+Character.toUpperCase(lastName.charAt(1))+Charac ter.toUpperCase(firstName.charAt(1))+"-"+randNums8[i];
System.out.println(result);
}
}