SOYlearningC# - Lesson 3: switch, while, do while >Switch It is a conditional operator that takes a value you code in (the expression), checks a list of values it has (cases) and performs an action whose case value matches the expression value ^Example: switch (expression) { case value1; Insert code here; break; case value2; insert another code here; break; } ^Example end You can code in as many cases as you need >switch default switch has another function besides the cases - default. Default is basically a case without a set value, i.e. so if the expression doesn't match any case value, then switch will perform the default action ^Example switch (expression) { case value1; insert code here; break; default; shit nophono codes fam about; break; } So, if the expression = value1, them switch performs whathever code there is in that case. However, if expression doesn't match value1, sice there are no more cases with specific values to match, them switch performs shit nophono codes fam about >multi-case actions Another switch function is being able to code a single action to several cases ^Example switch (expression) { case value1; case value2; Code; break; } In this case, if expression is equal either to value1 or value2, switch will perform the code because both these cases possess that code >while It is a loop that allows the program to execute an action as long as a specific condition is met ^example while (condition) { code; } >do while It is a loop that first does an action and then checks the condition after the action is done. Therefore, this loop will act at least once guaranteed, unlike regual while that needs the condition met before acting ^example do { Code; } while (condition);