I bought my son, also nine when we cruised, a black suit (sold as separates) from JC Penney. The pants and jacket were cheap to start with, and on sale were something like $14 for the pants and maybe upper $20's for the jacket. Both were washable. He wore this suit for both formal and semi-formal nights. Formal night he had a crisp white white shirt and wore a tie, semi- he had a slightly colored shirt and tie. I thought he looked great and it was not anything like incurring the expense of buying a top-of-the-line suit or tux. There are many sources of similar inexpensive clothes -- from JC Penney, Sears, etc. as well as other retailers online or even from eBay.
If you are concerned about dressing per the requested dress code:
For a nine-year-old I think that "nice" shorts may not be nice enough. A four or five-year-old might be able to get away with a shorts suit, like would be worn for Easter, but I don't picture an older child be willing to be dressed in truly formal shorts!
As far as dinner on the other nights, since shorts are specifically requested not to be worn to dinner, again, I would try some of the less expensive outlets for a couple of pairs of pants for him to wear (you can wash a couple of times during the cruise if you don't want to buy/bring more than two). A nice shirt (button-type or polo) is perfectly acceptable. I think that shorts are fine for him for breakfast and lunch.