Switch

The two ways of writing switch statements are:

switch(variable)
{
    case(val1):
    {
        code1;
    }
    case(val2):
    {
        code2;
    }
    default/otherwise:
    {
        code3;
    }
};
switch(variable)
    case val1:
        code1;
    case val2:
        code2;
    default/otherwise:
        code3:
end;