dimanche 27 septembre 2015

Using a Random Number in an If statement Which is is compared to an Int

In this Program I am trying to use an int number with a boolean random number

 if(usernumber = randnumber){
        System.out.println("Your are a Winner!");
        voucher = voucher + 10;
        System.out.print("\n");

    }else{
        System.out.println("The number is " + randnumber + "! Better luck next time!");
        System.out.print("\n");
    }

The problem is that each time i compile an error saying int and boolean cannot be converted pops up. Any help is appreciated

Aucun commentaire:

Enregistrer un commentaire