Abstract
This chapter explains the uses of simple selection, multiple selection, and nested selection in algorithms. The structure represents the decision making abilities of the computer. That is, a programmer would use the selection control structure in pseudocode to illustrate a choice between two or more actions, depending on whether a certain condition is true or false. There are a number of variations of the selection structure. Simple selection occurs when a choice is made between two alternative paths, depending on the result of a condition being true or false. The structure is represented in pseudocode using the keywords IF, THEN, ELSE, and ENDIF. Nested selection occurs when the word IF appears more than once within an IF statement. Nested IF statements can be classified as linear or nonlinear. Each variation of the selection structure developed in pseudocode can similarly be represented using a Nassi-Schneiderman diagram. The case structure was introduced as a means of expressing a linear nested IF statement in a simpler and more concise form. Case is available in many high level languages, and so is a useful construct to write in pseudocode.
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.