Justin van Wilgen wrote:Hi, you are missing a bracket on line 19, change it as follows:
Better make that (int)(Math.random() * 10). Your code first converts the result of Math.random() to an int. Since Math.random() always returns a double >= 0 and < 1, the cast will always result in 0. The total will therefore also be 0.
By multiplying first, then casting, you're casting something that's >= 0 and < 10 to an int. That can be any int from 0 to 9.