For part A, here are my thoughts:

For the first 0000 to 0999, there are 1000 numbers. Then you have to add in all the numbers ending in 0. These are a little trickier to see. So we are looking for 1000, 1010, 1020, ... , 1090. That's a total of 10 numbers between 1000 and 1090 (inclusive). We also have to remember 1100, 1110, 1120, ... , 1190. So there are 10 numbers between each increment of a hundred. And between each thousand there are 10 increments of 100. Finally we are starting at 999 and proceeding to 9999, in which there are 9 increments of a thousand. So my total for part A comes to: