 Working backwards  Do any of the phrases appear in the string?  Check for each phrase independently  If any appears, condition is TRUE  If TRUE,

Slides:



Advertisements
Similar presentations
Decision Structures - If / Else If / Else. Decisions Often we need to make decisions based on information that we receive. Often we need to make decisions.
Advertisements

Logic Gates.
Control Flow Statements: Repetition/Looping
Flow of Control Usually the order of statement execution through a method is linear: one after another flow of control: the order statements are executed.
Selection Control Structures Chapter 5: Selection Asserting Java © Rick Mercer.
Discussion1 Quiz. Q1 Which of the following are invalid Java identifiers (variable names)? a) if b) n4m3 c) Java d) e) DEFAULT_VALUE f) bad-choice.
Lecture # 21 Chapter 6 Uptill 6.4. Type System A type system is a collection of rules for assigning type expressions to the various parts of the program.
Karnaugh Maps. What are karnaugh maps? Boolean algebra can be represented in a variety of ways. These include: Boolean expressions Truth tables Circuit.
A Quick Look at Quantified Statements. Why are Quantified Statements Important? The logical structure of quantified statements provides a basis for the.
Assignment 2 Sample problems. Consider the following expression: ((False and not True) or False or (True and not True)) True False.
 UPPER – Changes stuff to UPPERCASE › “cookie” becomes “COOKIE”  lower – Anybody wanna guess? › “DuH LoLoLoL” becomes “duh lololol”  Valuable for checking.
Boolean Expressions and If Flow of Control / Conditional Statements The if Statement Logical Operators The else Clause Block statements Nested if statements.
Computer Science 101 The Boolean System. George Boole British mathematician ( ) Boolean algebra –Logic –Set theory –Circuits –Conditions in if.
XOR and XNOR Logic Gates. XOR Function Output Y is TRUE if input A OR input B are TRUE Exclusively, else it is FALSE. Logic Symbol  Description  Truth.
Decision Structures and Boolean Logic
Recursion A method is recursive if it makes a call to itself. A method is recursive if it makes a call to itself. For example: For example: public void.
Programming in Java (COP 2250) Lecture 11 Chengyong Yang Fall, 2005.
1. We’ve learned that our programs are read by the compiler in order, from top to bottom, just as they are written The order of statement execution is.
Boolean Algebra. Boolean algebra (or Boolean logic) is a logical calculus of truth values, developed by George Boole in the late 1830s. It created a notation.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley STARTING OUT WITH Python Python First Edition by Tony Gaddis Chapter 4 Decision.
Searching The Internet By: Mrs. Bushman. How Do You Search Decide what you are looking for Remember: Garbage in, Garbage out.
Conditions in Java. First…Boolean Operators A boolean data type is always true or false. Boolean operators always return true or false For example: (x.
Decisions  Relational operators  Operate on two numbers or two Strings  ==, !=, >, >=,
4. Computer Maths and Logic 4.2 Boolean Logic Simplifying Boolean Expressions.
Quiz 3 is due Friday September 18 th Lab 6 is going to be lab practical hursSept_10/exampleLabFinal/
Flow of Control Unless indicated otherwise, the order of statement execution through a method is linear: one after the other in the order they are written.
Input Validation 10/09/13. Input Validation with if Statements You, the C++ programmer, doing Quality Assurance (by hand!) C++ for Everyone by Cay Horstmann.
Decisions in Python Boolean functions. A Boolean function This is a function which returns a bool result (True or False). The function can certainly work.
Overview Excel is a spreadsheet, a grid made from columns and rows. It is a software program that can make number manipulation easy and somewhat painless.
Validation using Regular Expressions. Regular Expression Instead of asking if user input has some particular value, sometimes you want to know if it follows.
Laws of Boolean Algebra Commutative Law Associative Law Distributive Law Identity Law De Morgan's Theorem.
Boolean Algebra Boolean Assertions Statements that will result in true or false outcomes a > 50 = = ba
Basic Definitions of Set Theory Lecture 24 Section 5.1 Fri, Mar 2, 2007.
A: A: double “4” A: “34” 4.
booleans hold a true/false value We take advantage of this by using them to decide which route our program will take. Examples: stinky holds the boolean.
CS 139 – Programming Fundamentals Lecture 08A. Relational/comparison Operators Relational Operator Meaning > is greater than < is less than >= is greater.
ICS102 Lecture 8 : Boolean Expressions King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science.
White-Box Testing Statement coverage Branch coverage Path coverage
Structure Based Test Design
Excel IF Function.
CSC 108H: Introduction to Computer Programming
Logic Gates.
Logic Gates Benchmark Companies Inc PO Box Aurora CO
Boolean Expressions and If
Topics The if Statement The if-else Statement Comparing Strings
Boolean expressions Conditional statements and expressions
Logic Function Review.
Review Operation Bingo
Topics The if Statement The if-else Statement Comparing Strings
Types, Truth, and Expressions (Part 2)
Scratch: selection / branching/ if / If…else / compound conditionals / error trapping by Mr. Clausen.
Types, Truth, and Expressions (Part 2)
Chapter 4: Decision Structures and Boolean Logic
Logic Gates.
Logical Operations In Matlab.
Conditional Logic Presentation Name Course Name
Types, Truth, and Expressions (Part 2)
Lecture 5 Binary Operation Boolean Logic. Binary Operations Addition Subtraction Multiplication Division.
Programming In Lesson 4.
Evaluating Boolean expressions
Selection Statements Chapter 3.
Chapter 5 – Decisions Big Java by Cay Horstmann
AP Statistics Warm-up: Problem 5.26.
2-2 Logic Part 2 Truth Tables.
Chapter 4: Decision Structures and Boolean Logic
Tutorial Number 8 - Daniel Razavi
Lesson 3 Properties of Operations
Boolean Expressions September 1, 2019 ICS102: The course.
boolean Expressions Relational, Equality, and Logical Operators
Presentation transcript:

 Working backwards  Do any of the phrases appear in the string?  Check for each phrase independently  If any appears, condition is TRUE  If TRUE, then type "True Blue", else type "Not True Blue"

 Functions: FIND, SEARCH  Both return ERROR if not found  ISERROR returns TRUE if error  How do I get a TRUE if found?

 IF “UNC” is FOUND OR “Heels” is FOUND  IF FIND(“UNC) is NOT an ERROR OR FIND(“Heels”) is NOT an ERROR  OR( NOT(FIND(“UNC”)), NOT(FIND(“Heels”)) )

 TRUE and FALSE are simply two branches  But sometimes its easier to think AND rather than OR  It is NOT TRUE BLUE if all of the searches fail (AND)  It is TRUE BLUE if any of the searches succeed (OR)

 Consider the following two statements: If A is false or B is false If A is true and B is true  Let’s look at the truth table: ABNOT A or NOT BA and BNOT (A and B)

 5A+5B == 5(A+B)  Well, in Boolean… ~A OR ~B == ~(A AND B) ~A AND ~B == ~(A OR B)

 OR( NOT(FIND(“UNC”)), NOT(FIND(“Heels”)) )  NOT( AND( FIND(“UNC”), FIND(“Heels”) )

 What if not a blank after UNC?  See True Blue Worksheet

 Using PROPER causes the following quirk: I’Ve John’S  Is there a way to fix it? See Apostrophe Worksheet