When I try to run the program it asks me for my input and then just says "running" without any output until I close it. I do not see any issues with the code, and I have run this exact program before on a different computer (my home computer is far superior in processing power to the PC it ran on) is this a Netbeans bug?
int ticket [] = new int [6];
for (int i = 0; i < 6; i++)
{
ticket [i] = Integer.parseInt(JOptionPane.showInputDialog("Input a number:"));
}
int balls[] = new int [7];
for (int i = 0; i < balls.length; i++)
{
boolean keepLooking = true;
int b = (int)(Math.random()*6 + 1);
while(keepLooking)
{
keepLooking = false;
for (int j = 0; j < balls.length; j++)
{
if (balls [j] == b)
{
keepLooking = true;
}
}
}
balls [i] = b;
}
int bonus = balls[6];
int matching = 0;
boolean bonusMatch = false;
for (int i = 0; i < 6; i++)
{
for (int j = 0; j < 7; j++)
{
if (ticket[i] == balls[j])
{
matching = matching +1;
}
}
if (ticket[i] == balls[6])
{
bonusMatch = true;
}
}
System.out.println("The winning balls are: ");
for (int i = 0; i < 6; i++)
{
System.out.print(" " +balls[i]);
}
System.out.println(" And the bonus ball is " +balls[6]);
int Payout = 0;
if (matching == 3)
{
System.out.println("Your payout was: R57");
}
else if (matching == 4)
{
System.out.println("Your payout was: R1033");
}
else if (matching == 5)
{
if (bonusMatch = true)
{
System.out.println("Your payout was: R2300000");
}
else
{
System.out.println("Your payout was: R55491");
}
}
else if (matching == 6)
{
System.out.println("Your payout was: R14000000");
}
}