(1) Code that ends with zero looks like this:
XXXXX0
Since each an X has a possibility of 10 digits and the last digit has only 1 possibility.
(10)(10)(10)(10)(10)(1)
=(105)(1)
=100,000 codes
(2)These are the only possible formats:
2018XX, X2018X, XX2018
Remember, each X has 10 possible digits.
(10)(10) + (10)(10) + (10)(10) = 300 codes