Example of compound condition, COBOL Programming

Example of compound condition:

In common, a compound condition has the form which is as shown below:

37_compound condition.png

Where condition-1 & condition-2 can be any one of the below:

  • a simple condition
  • a negated simple condition
  • the compound condition optionally enclosed in the parentheses
  • the negated compound condition where a compound condition enclosed in the parenthesesis preceded by NOT

It might be noted that no two logical operators can appear side by side except that the operators AND or OR may be instantly followed by NOT.

By using the above explained rules, fairly complicates compound conditions can be constructed. Though, in real practice, the requirement for a complicated compound condition hardly arises. For the sake of readability, it is suggested that the use of complex compound conditions must be avoided.

The illustration below is of the use of the compound condition. Let's take the sentence

 IF AGE IS LESS THAN 30 AND (HIGHLY-EDUCATED OR 

 HIGHLY-EXPERIENCED) MOVE 3 TO BONUS-CODE.

Here, HIGHLY-EDUCATED and HIGHLY-EXPERIENCED are the condition names. When either of them is true and if AGE is less than 30, 3 will be moved to the BONUS-CODE. Note the importance of parentheses. If these are omitted, the compound condition can become true if HIGHLY-EXPERIENCED is true regardless of the value of AGE and that of the condition name HIGHLY-EDUCATED.

Posted Date: 10/17/2012 1:47:14 AM | Location : United States







Related Discussions:- Example of compound condition, Assignment Help, Ask Question on Example of compound condition, Get Answer, Expert's Help, Example of compound condition Discussions

Write discussion on Example of compound condition
Your posts are moderated
Related Questions
I need help with a COBOL programming assingment. I have started the program but I need help completing the program. I have 5 errors. Here is the question. 10. Suppose your company

STATEMENTS FOR SEQUENTIAL FILES: A basic operation on a file includes the reading and writing of its records. Whenever the file is sequential, there are three verbs for the

77 level used for- It is Elementary level item. it Cannot be subdivisions of other items or cannot be qualified, or they can be subdivided themselves.

Comparison of the Numeric Operand with Nonnumeric Operand: The numeric operand can be compared to the nonnumeric operand subject to the restrictions which are as follows.

Currency Sign - edit characters for numeric data: $ (Currency Sign): The single currency sign can appear at the leftmost place of a picture. In that situation the $ cha

Minus sign - edit characters for numeric data: The minus sign can appear either at the leftmost or rightmost location of the picture. If an item is negative, a minus sign will

REWRITE STATEMENT: The REWRITE statement has the format for a relative file as shown below, REWRITE record-name  [ FORM identifier ]

CONDITION - COBOL Programming: The condition is an entity which at one point of time can have only one of the two values - true or false. As we already know that, the IF verb

MERGE VERB WITH OUTPUT PROCEDURE: Like the sort verb, the merge verb can also have an output procedure. The syntax of the MERGE verb is as shown below:   The r

INDEXED TABLES: The OCCURS clause that is used to define tables can optionally have an INDEXED phrase. This phrase involves the names of data items which are to be used as sub