L08-Boolean-exp1

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

• Notes
• 14

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

ICS102 Lecture 8: Boolean Expressions King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science Department

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

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
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

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

December 6, 2010 ICS102: The course 4 - Java Comparison Operators
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

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

This is the end of the preview. Sign up to access the rest of the document.
• Fall '08
• ZAMAN
• Saudi Arabia, Fahd of Saudi Arabia, King Fahd University of Petroleum & Minerals College of Computer Science & Engineering

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern