Edit week 3 class exercise using switch statement