A criticism of the break statement and the continue statement (in a loop) is that each is unstructured. Actually, break and continue statements can always be replaced by structured statements, although doing so can be awkward. Describe in general how you would remove any break statement from a loop in an app and replace it with a structured equivalent. [Hint: The break statement exits a loop from the body of the loop. The other way to exit is by failing the loop-continuation test. Consider using in the loop-continuation test a second test that indicates “early exit because of a ‘break’ condition.”] Use the technique you develop here to remove the break statement.
What will be an ideal response?
A loop can be written without a break by placing in the loop-continuation test a second
test that indicates “early exit because of a ‘break’ condition.” Alternatively, the
break can be replaced by a statement that makes the original loop-continuation test
immediately false, so that the loop terminates.
You might also like to view...
The www.nola.gov portion of the URL http://www.nola.gov is an example of a(n) ________
Fill in the blank(s) with correct word
A password that contains a combination of uppercase and lowercase letters, numbers, and symbols is called a(n) ________ password
Fill in the blank(s) with correct word
Which of the following can be used as a source for a binding properties?
a. Integer b. Double c. IntegerProperty d. DoubleProperty e. String
A detailed chain of custody report forms part of ________ specific documentation
Fill in the blank(s) with the appropriate word(s).