Final answer:
a) If digits can be repeated, there are 10,000 possible codes. b) If no repeated digits are allowed, there are 5,040 possible codes.
Step-by-step explanation:
a) If you can repeat digits, there are 10 possible choices for each of the four digits. So the total number of possible codes would be 10^4 = 10,000.
b) If you cannot repeat digits, there are 10 choices for the first digit, 9 choices for the second digit (since one digit has already been used), 8 choices for the third digit, and 7 choices for the fourth digit. So the total number of possible codes would be 10 x 9 x 8 x 7 = 5,040.