switch statement and if statement