Skip to content

Instantly share code, notes, and snippets.

@WPDC
Last active December 14, 2015 02:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WPDC/cf45af7e267676558d52 to your computer and use it in GitHub Desktop.
Save WPDC/cf45af7e267676558d52 to your computer and use it in GitHub Desktop.
CS0110 3.4 - Multi-decision tree converted to switch/case
if ( weatherCondition == 'sunny' )
go for a walk
else if ( weatherCondition == 'raining' )
dance in the rain
else if ( weatherCondition == 'foggy' )
sound the fog horn
else if ( weatherCondition == 'snowing' )
build a snowman
else
read a book
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment