Changes 'if' statement to a 'switch' statement.