Logical Operators Jumps Logical Operators The different logical operators found in Java Rational Operators The different rational operators found in Java.

Slides:



Advertisements
Similar presentations
Code Tuning Techniques CPSC 315 – Programming Studio Fall 2008 Most examples from Code Complete 2.
Advertisements

Logic Gates.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 4: Control Structures I (Selection)
Selection Control Structures Chapter 5: Selection Asserting Java © Rick Mercer.
Comp Sci Control structures 1 Ch. 5 Control Structures.
MONTEGO BAY HIGH SCHOOL INFORMATION TECHNOLOGY THE EXCEL IF FUNCTION.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 4 Making Decisions in a Program.
The CPU Revision Typical machine code instructions Using op-codes and operands Symbolic addressing. Conditional and unconditional branches.
Conditional Statements Introduction to Computing Science and Programming I.
Chapter 4 Control Structures I. Objectives ► Examine relational and logical operators ► Explore how to form and evaluate logical (Boolean) expressions.
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.
Basic Elements of Programming A VB program is built from statements, statements from expressions, expressions from operators and operands, and operands.
COMP 14 Introduction to Programming Miguel A. Otaduy May 18, 2004.
Flow of Control is Sequential unless a “control structure” is used to change that there are 2 general types of control structures: Selection (also called.
Conditions, logical expressions, and selection Introduction to control structures.
Primitive Types CSE 115 Spring 2006 April 3 &
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 4 Decision Structures and Boolean Logic.
OperatorstMyn1 Operators The sequence in which different operators in an expression are executed is determined by the precedence of the operators. Operators.
Decision Structures and Boolean Logic
Python – Making Decisions Lecture 02. Control Structures A program that only has one flow is useful but limited. We can use if statements to make these.
Fortran 2- More Basics Chapter 3 in your Fortran book.
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.
Chapter 3. Outline Relational Operators Loops Decisions Logical Operators Precedence Summary.
If…else statements. Boolean Expressions Boolean expression - An expression whose value is either true or false true = 1 false = 0 Datatype: boolean.
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
1 2. Program Construction in Java. 2.4 Selection (decisions)
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.
Copyright 2003 Scott/Jones Publishing Making Decisions.
Conditional Expression One of the most useful tools for processing information in an event procedure is a conditional expression. A conditional expression.
1 Programming in C++ Dale/Weems/Headington Chapter 5 Conditions, Logical Expressions.
Chapter 4 Control Structures I. Chapter Objectives Learn about control structures Examine relational and logical operators Explore how to form and evaluate.
ICT Introduction to Programming Chapter 4 – Control Structures I.
5-7 Rational Exponents Objectives Students will be able to:
More Python!. Lists, Variables with more than one value Variables can point to more than one value at a time. The simplest way to do this is with a List.
Basic Conditions. Challenge: ● Ask the user his/her name ● If it’s “Wally,” jeer him ● Pause video and try on your own.
Chapter 2 Programming with PHP Part 2. handle_form.php Script 2.3 on pages 46 cript_02_03/form.html
Conditional Control Structures Chapter 5. Goals and Objectives Understand conditional control structures. Demonstrate the use of decision structures to.
Control Statements: Part1  if, if…else, switch 1.
Title Category #1 Category #2 Category #3Category #
Identities, Contradictions and Conditional Equations.
3-8 to 3-10 Mixed Numbers and Improper Fractions What You’ll Learn To write a mixed number as an improper fraction To write a mixed number as an improper.
IF STATEMENTS AND BOOLEAN EXPRESSIONS. BOOLEAN EXPRESSIONS Evaluate to a value of true or false Use relational or equivalence operators Boolean operators.
IST 210: PHP Logic IST 210: Organization of Data IST2101.
 Type Called bool  Bool has only two possible values: True and False.
Chapter 4: Control Structures I
Logic Gates.
Introduction to Programming for Mechanical Engineers (ME 319)
Comparison Operators Relational Operators.
Topics The if Statement The if-else Statement Comparing Strings
Flow of Control.
Selection By Ramin && Taimoor
Control Structures – Selection
Flow of Control.
Topics The if Statement The if-else Statement Comparing Strings
Computers & Programming Languages
Chapter 8 JavaScript: Control Statements, Part 2
Georgia Institute of Technology
Logical assertions assertion: A statement that is either true or false. Examples: Java was created in The sky is purple. 23 is a prime number. 10.
Programming with PHP Part 2
Flow of Control.
Visual Basic – Decision Statements
Flow of Control.
Microsoft Visual Basic 2005: Reloaded Second Edition
Computer Science Core Concepts
Control Structure Chapter 3.
Programming Concepts and Database
Relational Operators.
Topics discussed in this section:
Control Structure.
Flow of Control Flow of control is the order in which a program performs actions. Up to this point, the order has been sequential. A branching statement.
Presentation transcript:

Logical Operators Jumps Logical Operators The different logical operators found in Java Rational Operators The different rational operators found in Java

Jumps A jump is also known as a branch A jump is when you program skips certain steps to move on to another block of code There are two types of jumps 1. Unconditional Jump = no condition is set 2. Conditional jump = a condition has to be satisfied in order for the jump to compare

Logical Operators Logical operators are functions used in Java They are used to set certain conditions These conditions are used when we have conditional jumps in our programs

Different Logical Operators There are many different operators, some of these include the following Logical OperatorMeaning &Logical AND – both must be true |Logical OR – One or both must be true ^Logical XOR – the NOT of the OR operator ||Short Circuit OR – this stops when it finds the first true &&Short Circuit AND – this stops when it finds the first true !Logical Unary NOT – true becomes false and vice versa

Rational Operators Rational operators in java are used when we wish to make a comparison Rational operators just like logical operators are used for conditional jumps in our java program s

Different Logical Operators Relational Operators Meaning ==Equal To >Greater Than <Less Than >=Greater Than or Equal To <=Less Than or Equal To !=Not Equal To

Is the answer to these conditions true of false? == *5 > – 4 < >= (10+5) / 7 <= *2 != 24

Is the answer to these conditions true of false? == 13  False 2. 5*5 > 10  True – 4 < 5  True >= (10+9)  False / 7 <= 4  True 6. 12*2 != 24  False