This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full 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.
- Fall '08