Switch-Case+(Kyle+Skabelund)

Pages 1. Introduction 2. Switch-Case statements 3. Example 4. Example (continued)

Content 1. Introduction to switch case statements. What are they? What do we use them for? Why do we use them? 2. Explain how the user should use them, in general. 3. Show some examples of problems where switch case statements could be used. 4. Tell the user how switch statements can be used to solve the problems.

Vicki: Can this be made to use discovery learning? Vicki: One thing that isn't clear about the switch is how it is implemented. The implementation answers the following questions: a. Are ten nested ifs slower than a switch statement with 10 cases? b. Why do some languages have you fall through to the next case? c. Why can't you have cases like ">10" as you would with a conditional.

Mr. Weeks: That might work in lots of situations--present it like a black box. I wonder if we didn't even tell them what a switch statement did or was used for but presented examples for which the students might vary some parameters in order to discover what it does, how it does it, and with the right examples, where it would be useful.