Advertisement

Selection

  • Joés M. Garrido
Chapter

Abstract

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.

Keywords

Case Statement Logical Operator Selection Statement Boolean Expression Hourly Rate 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer-Verlag US 2009

Authors and Affiliations

  1. 1.Department of Computer & Information SystemsKennesaw State UniversityKennesawUSA

Personalised recommendations