To fully describe algorithms, four design structures are used: sequence, selection, repetition, and input/output. This chapter explains two selection statements in the OOSimL language. The statements are the if and the case statements. Conditions are used in the selection statements. Conditions are expressions of type Boolean that evaluate to a truth-value (true or false). Simple conditions are formed with relational operators for comparing two data items. Compound conditions are formed by joining two or more simple conditions with the logical operators. For examples of applying the selection statements, two problems are discussed: the solution of a quadratic equation and the solution to of the salary problem.
KeywordsCase Statement Logical Operator Selection Statement Boolean Expression Hourly Rate
Unable to display preview. Download preview PDF.