For Loop - Integers stuck @ "0"
posted 11 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I have this code running correctly in Eclipse all except that it seems no matter where I declare, highest, lowest, average they always seem to stay at "0".
I have a feeling the location of the Initialization is not the error since I have tried moving it to inside differ loops.
Stipulations on writing this code are:
Note: You do not need to use array to save each input score for this lab. A Single loop to read in each grade, compare with the current highest grade, lowest grade, and
calculate the running sum at the same time.
Yes this is homework and I have dug all through my book and the web trying to figure out where I messed up.
I have a feeling the location of the Initialization is not the error since I have tried moving it to inside differ loops.
Stipulations on writing this code are:
Note: You do not need to use array to save each input score for this lab. A Single loop to read in each grade, compare with the current highest grade, lowest grade, and
calculate the running sum at the same time.
Yes this is homework and I have dug all through my book and the web trying to figure out where I messed up.
posted 11 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
What is the following checking for?
Jordan Grimes
Greenhorn
Posts: 4
posted 11 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
That is checking to make sure the grade entered is between 0and100. But now that you mention it...that creates an infinite loop. I just entered 101 and I get an infinite loop of the println ().
posted 11 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Exactly...
And besides, it doesn't perform what is required because it never prompts the user for input...
And besides, it doesn't perform what is required because it never prompts the user for input...
Jordan Grimes
Greenhorn
Posts: 4
posted 11 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Ok, i believe I have fixed the Grade Checking issue...and my integers are now display numbers but the while loop runs indefinitely.
posted 11 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Before I leave the Ranch for the night I will leave you with this hint -> The scope in which you declare variables determine their values upon entering the scope and exiting...
Jordan Grimes
Greenhorn
Posts: 4
posted 11 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Ok thanks. That makes since. Think I got it now.
posted 11 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Also you must think about what you are trying to do in terms you understand before translating it to code [English]...
For your range checking problem you are saying -> while the value entered is not in range, get another value
Which translates to:
For your range checking problem you are saying -> while the value entered is not in range, get another value
Which translates to:
| Do Re Mi Fa So La Tiny Ad The new gardening playing cards kickstarter is now live! https://www.kickstarter.com/projects/paulwheaton/garden-cards |







