mercredi 12 octobre 2016

Can someone help me with this if loop?

Can someone tell me how to make an if loop reset? Here is my code

 import javax.swing.JOptionPane;

public class Piss {
    public static void main(String[] args) {
        int num1, num2 = 3, num3, num4, num5;
        String question = JOptionPane.showInputDialog("Enter what you think number 2 is");
        if (Integer.valueOf(question)!=(num2)){
            JOptionPane.showMessageDialog(null, "Fel");
        }else {
                num1 = num2*num2;
                num4 = num2+1;
                num3=10-num2;
                num5=14-num3;
                JOptionPane.showMessageDialog(null, "Congrats, you solve it PIN="+num1+num2+num3+num4+num5);
            }
        }
    }

Aucun commentaire:

Enregistrer un commentaire