Use `switch` to check the value of the same variable.