Download presentation
Presentation is loading. Please wait.
Published byWidyawati Pranata Modified over 5 years ago
1
Chapter 3: Selection Structures: Making Decisions
2
Case-type Statements Case or Switch statements can be used to more easily code multiple alternative If’s Use the special or keyword Case Use Select to start the Case statement Specify the expression to be evaluated List each possible value of the expression and what to do if that is that value is the true one A Break at the end of each Case tells the computer to skip the rest of the conditions Use End Case to end the statement The results will be the same as a correctly coded multiple-alternative If-Then-Else structure
3
Example Select Case of Choice Case 1: Set Operation = “Add” Break
Set Operation = “Subtract” Case 3: Set Operation = “Multiply” Case 4: Set Operation = “Divide” End Case
4
Any Questions ?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.