Ryan Cridelich wrote:end now equals true, so the program should proceed to printing out the array.
Going into that code, the boolean end = false, so if stop is entered, then the boolean is changed to true, so the program should go to the last step in the program.
Ryan Cridelich wrote:
What I meant by last step in the program, is that it should proceed to the last set of statements in the program that need to be executed before program completion.
I am assuming that because end was originally set to false, that as long as end equals false the program will continue looping and asking for user input, but once end equals true the program stops asking for input.
I'm not sure how else to determine if the sentinel value has been entered or not.
Everything is theoretically impossible, until it is done. ~Robert A. Heinlein
Ryan Cridelich wrote:No, I have not read anywhere about what Java considers to be the last step in any program. That was, like you said, an assumption, that I did not base off of anything, or any reading. I just assumed by looking at the program, that the last block of statements, were what I would consider to be the last step, but evidently, I was wrong, and isn't that besides the point.
As far as the whole end equaling true or false thing, I'm not sure how that's supposed to work. I remember I looked up how to validate if the sentinel value has been entered or not, because I wasn't sure how to do it, and the example I found, had that in there, so I used it.
Tina Smith wrote:...and if it is, you need to do something to stop (break) the loop.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Ryan Cridelich wrote:
I have all of those variable initialized at the top of that class.
Ryan Cridelich wrote:I'm confused as to why I need to list those variables there to begin with, or what their purpose is supposed to be,
It just says that the actual and formal argument lists differ in length. What is says is required is String, and four doubles, but found nothing.
You guys haven't done this much, have ya? I suggest you study this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|