In a series of boolean expressions, a variable carries a "control flag.Replace the control mark with a break or return statement.
Motivation: In a series of conditional expressions, you will often see the control mark used to determine when to stop the conditional check. The trouble caused by such a tag exceeds the convenience it brings. People use such control labels because structured programming principles tell them:ProgramOnly one entry and exit are allowed. The "Single Exit" principle will let youCodeAdds annoying control labels to greatly reduce the readability of conditional expressions. This isProgramming LanguageThe reason for providing break and continue statements: use them to jump out of complicated conditional statements. The effect of removing the control mark is often surprising: the true purpose of the Condition Statement is much clearer.
Practice: 1. The most obvious way to deal with the control mark is to use the break or continue statement.
2Find the control tag value that will allow you to jump out of this logic.
3Find the statement that assigns values to the tag variables, and use the appropriate break or continue statement.
4, After each replacement, compile and test.