# Search:

Type: Posts; User: GregBrannon

1. ## Thread: Need help with YES/NO Loop in Fibonacci Sequence

by GregBrannon
Replies
11
Views
425

2. ## Thread: Need help with YES/NO Loop in Fibonacci Sequence

by GregBrannon
Replies
11
Views
425

### [SOLVED] Re: Need help with YES/NO Loop in Fibonacci Sequence

Oh (disappointed). You couldn't figure out how to do 1/2?
3. ## Thread: Need help with YES/NO Loop in Fibonacci Sequence

by GregBrannon
Replies
11
Views
425

### [SOLVED] Re: [UNSOLVED] Need help with YES/NO Loop in Fibonacci Sequence

Little details like using 1 or 2 instead of YES/NO are fundamental to the design, not helpful tips.

This is nothing you can't do, but here's an elementary example. You can figure out how to...
4. ## Thread: Need help with YES/NO Loop in Fibonacci Sequence

by GregBrannon
Replies
11
Views
425

### [SOLVED] Re: Need help with YES/NO Loop in Fibonacci Sequence

Close.

while (again = true)
'=' is an assignment operator. Further, a comparison using a boolean is unnecessary simply:

while ( again )
will do (as I showed originally).

Then,
5. ## Thread: Need help with YES/NO Loop in Fibonacci Sequence

by GregBrannon
Replies
11
Views
425

### [SOLVED] Re: Need help with YES/NO Loop in Fibonacci Sequence

There's no such thing as a "YES/NO Loop" in Java.

By using an if statement to set a flag ('again' in my example) that indicates whether the loop will repeat. My example does everything but write...
6. ## Thread: Need help with YES/NO Loop in Fibonacci Sequence

by GregBrannon
Replies
11
Views
425

### [SOLVED] Re: Need help with YES/NO Loop in Fibonacci Sequence

Using a while loop, the general form is:
while ( again )
{
// the code to repeat

// ask the user if the loop should repeat,
// if yes, again stays true
// if no, again =...
Results 1 to 6 of 6