|
-
 Originally Posted by Zoma
Switches only work on types with discrete values. In real life you'd use and if-then-else block using string comparisons. If this is a school assignment and requires doing it using switches, then you can do something like this:
And if you only have to do the do the few states you have listed, you can just do a case statement based on the first letter (since they are unique).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|