For the $10,000 you can just take it as is, using the 5% and 2 periods. The rate doesn't change during this time.
For the $30,000, you need to first find the present value of where it will be in 4 years when the rate changes. That is, you have to "back into" stuff like this. We know it's worth $30,000 in 7 years (FV). 4 years from now is a present value relative to the 7 years. So how many years will it be at 8%? First find the present value it will be at the 4-year mark, at 8%. Then take that value and find the present value of it for the first 4 years at the 5%. Does that make sense?
You can't add the original numbers together as they are two individual things. Whether you'd want to add the answers together I don't know. The wording isn't clear on that point. Unless you're using a template that only has space for one number, I would list them individually.
So this is how liberty dies... with thunderous applause.