A criticism of the break statement and the continue statement is that each is unstructured. Actually, these statements can always be replaced by structured statements, although doing so can be awkward. Describe in general how you’d remove any break statement from a loop in a program and replace it with some 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 tech- nique 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 sec- ond 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...
It is the responsibility of the ____ professional to establish the physical security requirements for the personnel security function.
A. physical security B. enterprise continuity C. incident response D. logical security
The ____________________ function incrementally writes data to a text file and returns the number of bytes written to the file.
Fill in the blank(s) with the appropriate word(s).
The single-file web page file format is called ____________________.
Fill in the blank(s) with the appropriate word(s).
When reading an instruction, the operating system can tell the ____ of each group of digits by its location in the line and the operation code.
A. function B. value C. order D. assignment