Steve Fahlbusch wrote:Now - two issues - you are declaring a new int each time you generate a random number - you should move the declaration out of the loop and only set the value in the loop.
Effective Java (2nd Edition) wrote:The most powerful technique for minimizing the scope of a local variable
is to declare it where it is first used. If a variable is declared before it is used, it’s
just clutter—one more thing to distract the reader who is trying to figure out what
the program does.
Kris French wrote:I understand how vast java is, but as of right now we have only studied if/else/switch statements, so naturally I had no idea how to begin this project. After doing a little homework I was able to get the 100, 3 digit numbers generated...
...but I cannot add then together. I have tried a few things that I found online, but either I didn't understand them or I could not get things to work out. Can someone please help give a nudge (or at my level, a violent shove) in the right direction. I appreciate the help.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Steve Fahlbusch wrote:you are declaring a new int each time you generate a random number - you should move the declaration out of the loop and only set the value in the loop.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Kris French wrote:It's already been fixed. ;)
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Not at all. Everybody else makes that sort of mistake, too.Kris French wrote:. . . I can be pretty dense sometimes. . . .