COP 3330 Lecture Notes - Lecture 4: Switch Statement, Decision-Making
Document Summary
Statements in source code files are generally executed sequentially. Most basic of all control flow statements. Instructs program to execute a certain section of code. Provides a secondary path of execution when an if" clause evaluates false. Used when more than one condition needs to be evaluated. The value can satisfy more than one condition. Can have a number of possible execution paths. A body of a switch statement is the switch block. Switch evaluates the condition and then runs all the lines specified.