Exercises - Using Logical Expressions

About this task

A student applying to colleges has decided to evaluate them according to the following specifications:
IF  (inexpensive | scholarship) & (reputable | nearby)  THEN
   SAY  "I'll consider it."
ELSE
   SAY  "Forget it!"

A college is inexpensive, did not offer a scholarship, is reputable, but is more than 1000 miles away. Should the student apply?

ANSWER

Yes. The conditional instruction works out as follows:
IF  (inexpensive | scholarship) & (reputable | nearby)  THEN ...
     \__________/ \___________/   \_________/ \______/
        true          false          true      false
           \___________/               \_________/
               true                       true
                 \_________________________/
                            true

Task Task

Feedback


Timestamp icon Last updated: Tuesday, 7 January 2014


http://pic.dhe.ibm.com/infocenter/cicsts/v5r1/topic/com.ibm.cics.rexx.doc//dfhrx/examp3.html