L08-Boolean-exp1 - King Fahd University of Petroleum...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
ICS102 Lecture 8: Boolean Expressions Information & Computer Science Department
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
December 6, 2010 ICS102: The course 2 Outline Introduction Java Comparison Operators Evaluating Boolean Expressions Pitfall:  Using  ==  with Strings Lexicographic and Alphabetical Order Building Boolean Expressions Truth Tables Short-Circuit and Complete Evaluation Precedence and Associativity Rules Evaluating Expressions Rules for Evaluating Expressions
Background image of page 2
December 6, 2010 ICS102: The course 3 - Introduction A Boolean expression is an expression that is either  true  or  false The simplest Boolean expressions compare the value of two  expressions time < limit yourScore == myScore Note that Java uses two equal signs ( == ) to perform equality  testing:  A single equal sign ( = ) is used only for assignment
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
December 6, 2010 ICS102: The course 4 - Java Comparison Operators
Background image of page 4
December 6, 2010 ICS102: The course 5 - Evaluating Boolean Expressions Even though Boolean expressions are used to control branch and  loop statements,  Boolean expressions can exist independently as  well A Boolean variable can be given the value of a Boolean expression by  using an assignment statement A Boolean expression can be evaluated in the same way that an  arithmetic expression is evaluated The only difference is that arithmetic expressions produce a number 
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/05/2010 for the course ICS 102 taught by Professor Zaman during the Fall '08 term at King Fahd University of Petroleum & Minerals.

Page1 / 14

L08-Boolean-exp1 - King Fahd University of Petroleum...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online