Q:

Dice roll with a 50% chance of rolling 6

So I made this method of rolling a dice 100 times with a 50% chance of rolling 6.
Basic idea is that there are 50% odd numbers and 50% even numbers between 1 and 6, so if an even number is rolled, system prints 6 else it prints a random number between 1 and 5. Do you think this is correct?
public static void printDiceRolls(Random randGenerator) {
    for (int i=0; i < 30; i++) {
        int temp;
        temp = randGenerator.nextInt(6) + 1;
        if (temp%2 == 0) {
            temp = 6;
        }
        else
            temp = randGenerator.nextInt(5) + 1;
        System.out.print(" " + temp + " ");
    }
}

A:

Generate a random number between 1 and 10, inclusive on both ends.  If the number be 1 to 5, you rolled that number, otherwise, you rolled 6.  Note that there are 5 chances in this scheme to roll a 6 (i.e. 50%), and 5 total chances to roll 1 through 5 (i.e. the other 50%).
Random random = new Random();
int roll = random.nextInt(10) + 1;
if (roll > 5) {
    System.out.println("You rolled a 6");
}
else {
    System.out.println("You rolled a " + roll);
}

