First of all, I would define and implement a method named
rollTwoDice(), or some such thing, that returns the sum of two random die tosses. I would do this because the program will involve rolling the dice in more than one place, and I don't like to write duplicate code in multiple places in the program.
Anyhow...
Here's pseudo-code for the main game flow, as I see it:
Declare an int named value.
Set value equal to the result from a call to rollTwoDice().
IF value is equal to 2 or value is equal to 3 or value is equal to 12 THEN
You lose.
Game Over.
ELSE IF value is equal to 7 or value is equal to 11 THEN
You Win.
Game Over.
ELSE
Declare an int named point.
Set point equal to value.
Repeat the following loop as long as Game is not Over:
BEGIN LOOP
Set value equal to the result from a call to rollTwoDice();
IF value is equal to point THEN
You Win.
Game Over.
ELSE IF value is equal to 7 THEN
You Lose.
Game Over.
END IF
END LOOP
END IF
If that flow makes sense to you and if you think it satisfies the rules of the game as spelled out in your assignment, then try implementing it in Java. Any questions? Post again.
Now, if you want to practice using real dice so that you can compare with your program, come by my place, and I'll give you some lessons. We will be using my dice.
Bring cash. Checks and credit cards not accepted.
Cheers!
Z