summary03 - Chapter 7.2 Multiway Branches Branching...

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

View Full Document Right Arrow Icon
Truth Tables: if ( (false if (false ) Summary Ch 7.1 – 7.2 Chapter 7.1: Using Boolean Expressions And (&&) T T T T F F F T F F F F Or (||) T T T T F T F T T F F F Not (!) T F F T Short-circuit evaluation- if the first part of the statement is false, and it is an && statement, it skips the second part of the statement, whereas complete evaluation completes all statements, even if the first is false. Enumeration Types- can specify values for multiple constants – automatically assigns consecutive values beginning w/ 0 Enum MonthLength { NORTH = 0, SOUTH = 1, EAST = 2, WEST = 3};
Background image of page 1

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

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

Unformatted text preview: Chapter 7.2 Multiway Branches Branching Mechanism- chooses one from a number of alternative actions o If-else o If o While o Do-while Make sure you use braces to specify where one if statement ends and another begins Can use else if instead of indenting on another line and simplifying the code. Use switch statement to execute one of a number of cases Break statement to end the switch Default section to use any other possible answers Use functions to simplify code Can have blocks with variable declarations local to the compound statement...
View Full Document

This note was uploaded on 08/26/2009 for the course CS 140 taught by Professor Staff during the Fall '08 term at Southern Illinois University Edwardsville.

Page1 / 2

summary03 - Chapter 7.2 Multiway Branches Branching...

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

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