Hey, i have a problem with my school assignment. I can't get the "nummer" to work when i try to run the program. How do i get the "nummer" to work outside the for statement? I know the for statement is not done yet and may be wrong. But i don't get the "nummer" to work.
Sorry for my english if you don't understand.
Thank you for your time.
package uppgift;
import javax.swing.*;
public class Uppgift {
public static void main(String[] args) {
String a = JOptionPane.showInputDialog("Hur många gånger vill du kasta?");
int kast = Integer.parseInt(a);
int kast1;
for (kast1 = 1; kast1 == kast; kast1 = kast1 + 1) {
int nummer = (int) (12.0 * Math.random()) + 1;
}
JOptionPane.showMessageDialog(null, nummer);
}
}