Ask Learn Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Your goal was to add branching logic that matches one variable or expression against many possible values.
Using the switch-case
construct, you matched an employee's numeric level with their title. You used the switch-case
as a replacement for the if-elseif-else
construct to more succinctly express your intent of converting a Stock Keeping Unit (SKU) into a long-form description.
C# developers use if
and switch
selection statements, along with conditional operators, to branch their code. The experience you've gained using selection statements enables you to choose the best C# tool for expressing your intent in your code.
Microsoft and freeCodeCamp.org offer a training and certification combo on foundational C#. By completing this Learn module, you've already started. Explore freeCodeCamp's Foundational C# with Microsoft certification here: https://aka.ms/csharp-certification.
Please sign in to use this experience.
Sign in