This section contains 253 words (approx. 1 page at 300 words per page) |
The term compound condition refers to the use of operators to facilitate a specified action in programming languages. A compound condition connects conditional expressions, expressions that can produce a different action depending on the nature of the individual single conditions.
Single conditions, each of which involves a single comparison, can be united into a compound condition by the use of certain logical operators. The relevant operators are AND, OR, or NOT. As occurs with simple conditional expressions, the evaluation (outcome) of a compound condition is either true or false. If true, the requested information is retrieved. If the outcome is false, then no retrieval occurs. An example when a compound condition may be used would be if a financial database of a company was probed to generate a list of departments from a certain division that had budgets under $50,000. The need to invoke search criteria based on departments, divisions, and budgets would require multiple conditions.
The various operators used to create a compound condition each convey a specific meaning to the resulting condition. With the AND operator, the constituent simple conditions must all be true for the compound condition to be true. With the OR operator, if one of the simple conditions is true then all of the simple conditions will be true. Finally, the NOT operator is used to reverse the original condition. If the original condition was true, the new condition will be false, and if the original condition was false, the new condition will be true.
This section contains 253 words (approx. 1 page at 300 words per page) |