5-Booleans - while ((w >= 2.0) || (q...

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

View Full Document Right Arrow Icon
Background image of page 1

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

View Full DocumentRight Arrow Icon
Monday Oct 17 In class Multiple Choice Short answer program questions Closed book Four exam versions
Background image of page 2
+ - * /
Background image of page 3

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

View Full DocumentRight Arrow Icon
Operator Meaning == Equality != Non equality < Less than > Greater than <= Less than or equal to >= Greater then or equal to Relational Operators are used to compare two values to determine how they relate to each other Examples: (A == B) (X < Y)
Background image of page 4
in “if” statements if ( A == 6 ) { in “while” and “do. .while” while (Loopcounter < 1000 ) {
Background image of page 5

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

View Full DocumentRight Arrow Icon
Operator Meaning ! Not And || Or Logical Operators are used to link expressions (including relational expressions) together Examples: if (X || Y) if (!C)
Background image of page 6
Background image of page 7

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

View Full DocumentRight Arrow Icon
Background image of page 8
Background image of page 9

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

View Full DocumentRight Arrow Icon
Background image of page 10
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: while ((w &gt;= 2.0) || (q &gt;= 4.0)) if x is less than 0, AND y is 10 or greater w is 2 or greater, OR q is 4 or greater int x = 4; cout &lt;&lt; x ; yields 4 cout &lt;&lt; ( x == 4 ); yields true however, in the computer, true is represented by 1, false is represented by 0 A B A &amp;&amp; B F F F F T F T F F T T T A B A || B F F F F T T T F T T T T if (A &amp;&amp; B) both A AND B have to be true for the if statement to pass if (A || B) EITHER A OR B have to be true for the if statement to pass bool B, S, W, A; // burglar, smoke, water, alarm A = B || S || W; // makes sense?...
View Full Document

Page1 / 10

5-Booleans - while ((w &amp;amp;gt;= 2.0) || (q...

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

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