chapter 4

the same scenario but using switch case