Relational Operators.

Slides:



Advertisements
Similar presentations
Operator. Assignation (=). The assignation operator serves to assign a value to a variable. a = 5; It is necessary to emphasize that the assignation operation.
Advertisements

Chapter 3 Math Vocabulary
Lesson Objective: I can…
Unit 1; Part 2: Using Factors for Fractions and Solving Problems You need to be able to find the GCF, LCM and solve problems using them.
Solve Equations with Variables on Both Sides
Chapter 4 Inequalities < Less Than > Greater Than.
Wednesday, October 27 Objective: Students will identify solutions of inequalities and write inequalities. Today’s Agenda: 1.No homework due today. 2.Fill.
Chapter 4 Inequalities 4.1 Inequalities and Their Graphs.
Solutions to Equations and Inequalities Lesson 7.01.
Open Sentences.
Ch 1.4 – Equations & Inequalities
 Evaluate the following expressions. when x = 24 when x = 4 when k = 12 1) 2) 3)
Operators Precedence - Operators with the highest precedence will be executed first. Page 54 of the book and Appendix B list C's operator precedence. Parenthesis.
Inequalities. SymbolMeaning Greater Than =Equal Greater Than or Equal To.
InequalitiesInequalities. An inequality is like an equation, but instead of an equal sign (=) it has one of these signs: Inequalities work like equations,
Inequalities Symbols and line graphs. Symbols  < is less than  > is greater than  < is less than or equal to  > is greater than or equal to points.
Inequalities and their Graphs Objective: To write and graph simple inequalities with one variable.
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 51 Decisions Relational and Logical Operators If Blocks Select Case Blocks.
Solving Inequalities and their Graphs
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
< < < > < > <
Ch 9: Quadratic Equations F) Graphing Quadratic Inequalities Objective: To graph quadratic inequalities.
Lesson 1.4 Equations and Inequalities Goal: To learn how to solve equations and check solutions of equations and inequalities.
Basic Conditions. Challenge: ● Ask the user his/her name ● If it’s “Wally,” jeer him ● Pause video and try on your own.
3.4 Solving Equations with Variables on Both Sides Objective: Solve equations that have variables on both sides.
An Object-Oriented Approach to Programming Logic and Design Chapter 5 Making Decisions.
Chapter 1: Variables, Function Patterns, and Graphs 1.1 Using Variables.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
Solving Inequalities Using Addition & Subtraction.
Operators A binary operator combines two values to get one result: x OP y where OP is any binary operators such as +, -, *, /, ==, !=, >, &&, or even =.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
Solving One-Step Inequalities
Inequalities and their Graphs Objective: To write and graph simple inequalities with one variable.
Opener: Find three consecutive odd integers whose sum is -63 Integer #1 = n Integer #2 = n + 2 Integer #3 = n + 4 (n) + (n + 2) + (n + 4) = -63 3n + 6.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
IST 210: PHP Logic IST 210: Organization of Data IST2101.
Inequalities and their Graphs
Inequalities and their Graphs
Graphing Inequalities
Solving Equations with the Variable on Each Side
1-5 Equations Goals: Solve equations with one variable
Assignment statement:
Introduction to Variables, Algebraic Expressions, and Equations
Using Addition & Subtraction
Introduction To Robot Decision Making
Using Addition & Subtraction
Inequalities and their Graphs
Computers & Programming Languages
Solving Equations with Variables on Both Sides Day 2
6.1 to 6.3 Solving Linear Inequalities
3-1 Inequalities and their Graphs
Lesson Objective: I will be able to …
6.1 to 6.3 Solving Linear Inequalities
Introduction To Robot Decision Making
Using Addition & Subtraction
Chapter 3: Selection Structures: Making Decisions
Boolean Expressions to Make Comparisons
Data Types and Expressions
Chapter 10 Section 4.
Understanding Conditions
Chapter 1 Section 3.
Chapter 3: Selection Structures: Making Decisions
Objective Translate verbal sentences into equations and inequalities.
Algebra: Variables and Expressions
Using Addition & Subtraction
Solving Equations with Variables on Both Sides Day 2
Chapter 2 Sets Active Learning Lecture Slides
STATE STANDARDS S.P.I Apply properties to evaluate expressions, simplify expressions, and justify solutions to problems. S.P.I Write.
Presentation transcript:

Relational Operators

Relational Operators Relational operators are the symbols used in the condition to be evaluated in If statements: = = is the same as (the comparison operator) != is not the same as (not equal to) < less than > greater than <= less than or equal to >= greater than or equal to

Examples Given: A = 23, B = 16 Then: A > B is true A < B is false A >= B is true A <= B is false A != B is true A == B is false

Comparison vs. Assignment Operators There is a significant difference between the use of an equals sign (=) as the assignment operator and a double equals sign (==) as the comparison operator. As an assignment operator, the equals sign sets the value of an expression on the right side to the variable on the left side. As a comparison operator, the double equals sign asks the question, “Is the value of the variable on the left side the same as the value of the expression, number, or variable on the right side?” a single equals sign (=) signifies the assignment operator a double equals sign (==) signifies the comparison operator This is demonstrated in the examples that follow in the next slides.

The Assignment Operator (review from Chapter 3) Given: A = 14, B = 27 In programming code, the assignment statement: A = B sets the value of B to the variable A In other words, after this statement is executed, both A = 27 and B = 27. In this case, the equals sign is used as an assignment operator.

The Comparison Operator Given: A = 14, B = 27 Using relational operators, the statement: A == B is a comparison This statement asks the question, “Is the value of A the same as the value of B?” In this case, since A and B have different values, the answer is “no” and the statement would result in a value of False.

Any Questions ?