Answer: 360 different codes
=====================================================
Work Shown:
Your teacher gave you the wrong formula. You should use the nPr formula instead of nCr. This is because order matters when forming passcodes.
For instance, the password 3CJ5 is different from J5C3
For this problem, we have n = 6 different characters and we're selecting r = 4 of them.
A slightly alternative method is to notice there are 4 slots to fill. Each slot being a digit in the passcode.
For the first slot we have 6 choices. The second has 5 choices since we can't reuse whatever goes in the first slot. We count our way down until all four slots are filled. We then multiply out the values to get
6*5*4*3 = 30*12 = 360
which is the number of permutations where we pick four items from a pool of six total.