logical
play

Logical Operators How do we form compound logical statements? IF - PowerPoint PPT Presentation

Logical Operators How do we form compound logical statements? IF there is a pandemic AND I am in public, THEN I'll wear a mask. IF it is raining OR it is cold, THEN I'll grab my jacket. IF it is NOT a COMP110 assignment, THEN I will


  1. Logical Operators

  2. How do we form compound logical statements? • IF there is a pandemic AND I am in public, THEN I'll wear a mask. • IF it is raining OR it is cold, THEN I'll grab my jacket. • IF it is NOT a COMP110 assignment, THEN I will procrastinate.

  3. The operator truth table • The keyword is a boolean operator True False [boolean a] [boolean b] True True False False False False boolean value You read a truth table like a multiplication table. Start with a finger on one column label and one • If both expressions connected by the symbol are row label, per each side of the True , then the resulting boolean will be True . Otherwise it operator, and trace your way in. will be False .

  4. The operator truth table • The keyword is a boolean operator True False [boolean a] [boolean b] True True True False True False boolean value You read a truth table like a multiplication table. Start with a finger on one column label • If either expression connected by the symbol is and one row label, per each side True , then the resulting boolean will be True . of the operator, and trace your Otherwise it will be False . way in.

  5. The operator truth table • The keyword is a unary boolean operator. True False [ boolean a] not False True boolean value • The expression following the operator will evaluate to the opposite boolean value. True becomes False and False becomes True.

  6. Logical Operator Reference and or not Expression Evaluates to Expression Evaluates to Expression Evaluates to It is worth committing these to memory. Every programming language (including Excel) shares the same ideas of logical operators.

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend