using an if else statement to choose between 2 blocks of code