Computers & Programming Languages

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

Chapter 4: Control Structures I (Selection)
Week 10 Recap CSE 115 Spring For-each loop When we have a collection and want to do something to all elements of that collection we use the for-each.
Fall 2006AE6382 Design Computing1 Relational and Logical Operators Use relational operators to test two values Work with values of true and false Compare.
Boolean Logic & Truth Tables In today’s lesson we will look at: a reminder about truth values and NOT, AND, OR and EOR truth tables operator precedence.
Lesson Objective: I can…
C++ Operators CS242 COMPUTER PROGRAMMING T.Banan Al-Hadlaq.
David Stotts Computer Science Department UNC Chapel Hill.
ALGEBRA LESSON 2 EVALUATING EXPRESSIONS AND CHECKING.
Standard: Algebraic Functions 1.0 and 1.1 Students evaluate expressions with variables.
CHAPTER 4: Selection Control Structure. Objectives  Use the relational comparison operators  Learn about AND logic  Learn about OR logic  Make selections.
Lesson Topic: True and False Number Sentences Lesson Objective: I can…  Explain what the equality and inequality symbols include. They will determine.
Systems of Equations 7-4 Learn to solve systems of equations.
If…else statements. Boolean Expressions Boolean expression - An expression whose value is either true or false true = 1 false = 0 Datatype: boolean.
Algebra Equations Lesson 1-7 Pages Equations An Equation is a sentence that contains an equals = sign. The equals = sign tells you that the expression.
Activity 2 Practice.
Assignment statement: Assigns a value to a variable Variable must appear on the left side, value on the right side of the assignment operator Right side.
Chapter 4 Control Structures I. Chapter Objectives Learn about control structures Examine relational and logical operators Explore how to form and evaluate.
CS 240 – Computer Programming I Lab Kalpa Gunaratna –
In the last lesson we discussed about: Casting Precedence The “=“ used as an assignment operator Made a calculate average program.
Lesson 1.4 Equations and Inequalities Goal: To learn how to solve equations and check solutions of equations and inequalities.
Chapter 4 Making Decision Csc 125 C++ programming language Fall 2005.
Bell Work: Find the equation of the line that passes through the point (2,3) and has a slope of -2/5.
Chapter 1: Variables in Algebra
Visual Basic CDA College Limassol Campus COM123 Visual Basic Programming Semester C Lecture:Pelekanou Olga Week 4: Understand and implement Decisions.
Equations and Solutions Core Focus on Introductory Algebra Lesson 3.1.
Write and Evaluate Expressions GOAL: By the end of this lesson, we will ALL be able to write and evaluate addition and subtraction expressions.
TestScore < 80 testScore * 2 >= < w / (h * h) x + y != 2 * (a + b) 2 * Math.PI * radius
Solving Equations Using Logs. True or False? 1.Log 4 = log Log 15 = log 3 x log 5 3.Log 4 = log 8 – log 2 4.Log 64 = 2 log 8 5.Log 64 = 8 log 2.
Algebra 3 Lesson 2.6 Objective: SSBAT solve quadratic equations. Standards: M11.D
Equations With Fractions Lesson 4-6. Remember the Process: Isolate the variable Perform the inverse operation on the side with the variable. Perform the.
Identities, Contradictions and Conditional Equations.
Random Functions Selection Structure Comparison Operators Logical Operator
Algebra 1 Section 4.2 Graph linear equation using tables The solution to an equation in two variables is a set of ordered pairs that makes it true. Is.
Section Setting Up Word Problems. Lesson Objective: Students will: Learn to set up the type of complicated word problems that are often found in.
IST 210: PHP Logic IST 210: Organization of Data IST2101.
if ( condition ) statement; if is a Java reserved word The condition must be a boolean expression. It must evaluate to either true or false.
Relational Operator and Operations
Computer Science 210 Computer Organization
Sequence, Selection, Iteration The IF Statement
Section 7.1 Logical Operators
Operator Precedence Operators Precedence Parentheses () unary
Equations with Variables on Both Sides
Equations With Fractions
Expressions and Control Flow in JavaScript
Introduction To Robot Decision Making
Lesson Objectives: I will be able to …
7.5 Exponential and Logarithmic Equations
3.4 Computer systems Boolean logic Lesson 2.
Computers & Programming Languages
Relational Operators Operator Meaning < Less than > Greater than
Computers & Programming Languages
Relations vs. Functions Function Notation, & Evaluation
Introduction To Robot Decision Making
Computer Science Core Concepts
Conditional Logic Presentation Name Course Name
Expressions.
If you can easily isolate one of the variables,
What are the following properties?
Lecture 5 Binary Operation Boolean Logic. Binary Operations Addition Subtraction Multiplication Division.
Understanding Conditions
Solving Absolute Value Equations
Relational Operators.
ECS15 boolean.
Topics discussed in this section:
Introduction to Functions
Algebra: Variables and Expressions
Variables and Equations
Simplifying Numerical Expressions
Java Lessons 9 – 12 Mr. Kalmes.
Presentation transcript:

Computers & Programming Languages

Relational & Logical Operators Lesson2- Objectives Examine relational and logical operators Explore how to form and evaluate logical Boolean expressions

Operators that allows you to make comparisons in a program. Relational Operators Operators that allows you to make comparisons in a program.

Tip to Remember .. What is the difference between the two following operators ( = = and = )? = = determines two equations are equal = assigns a value of an expression to variable

What is the output of the following expressions if M = 6, D= 3, L=5 Task 1 What is the output of the following expressions if M = 6, D= 3, L=5 Expression Output System.out.println (M >= D); System.out.println (L > D); System.out.println (D > M); System.out.println (5 == ‘5’); System.out.println (8 <=5); System.out.println (M != L); true True False Work in pairs and answer activity P-215

Logical operators True True ! True True False True False

Evaluate each of the following expressions: Book Activity P-217 Evaluate each of the following expressions: Expression Output (18>=16) && (‘D’ <‘E’) (17 >=15) && (‘J’ <‘D’) (14>=5) | | (‘A’ >’B’) !(14>=5) | | (‘A’ > ‘B’) true False True

Order of precedence

Book Activity P219 true False True