' ' Car rental rules ' PRINT "How old is the customer" INPUT AGE PRINT "What is the credit limit" INPUT CREDIT ' IF AGE >= 21 AND CREDIT >= 10000 THEN PRINT "Rental Approved" ELSE PRINT "Rental Denied" END IF ' END
The result must be TRUE for both the age test and the credit test.
If both tests are passed, the AND
combines
the two TRUE values into the result of TRUE.
A 24 year old customer with $0 credit could not rent a car. The logical expression would look like this:
AGE >= 21 AND CREDIT >= 10000 --------- ---------------- true false ------------------ false
An eighteen year old with a $500,000 credit limit applies for a rental car. Will the program approve?