Describe in general how you would remove any continue statement from a loop in an app and replace it with some structured equivalent. Use the technique you develop here to remove the continue statement.
What will be an ideal response?
A loop can be rewritten without a continue statement by moving all the code that
appears in the body of the loop after the continue statement into an if statement that
tests for the opposite of the continue condition. Thus, the code that was originally
after the continue statement executes only when the if statement’s conditional expression is true (i.e., the “continue” condition is false). When the “continue” condition is true, the body of the if does not execute and the application “continues” to the next iteration of the loop by not executing the remaining code in the loop’s body. The answer shown here removes the continue statement from the if statement.
You might also like to view...
A _________ is a fixed length block of main memory.
Fill in the blank(s) with the appropriate word(s).
?Describe three different types of peripheral memory cards that are commonly used with PDAs.
What will be an ideal response?