Hi Peter!
First of all, Yamaha is not a bad choice for a student's trumpet. I never owned one, but I know them. The YTR-4335 is a standart student's trumpet and you sure are doing nothing wrong with that choice. The YTR-8310Z seems to be a newer model, I have never heard of that one. I read that it is a lightweight trumpet, which sure is good at the beginning, but I think it might become a problem in the future. Lightweight trumpets are easy to blow, but that is not what you would want from an allround trumpet.
I don't know much about the prizes, but have you consiedered a Bach trumpet. I would always prefer them to Yamaha, but they used to be a little more expensive. I played a Bach for 10 years and I was very happy with it, because it really was a very good all-rounder. It is a good student's trumpet, but can be used at higher levels too. Bach would be my first choice, but Yamaha is not bad at all.
Music washes away from the soul the dust of everyday life. - Berthold Auerbach