Answer: $5,000
Step-by-step explanation:
First of all John's tax basis in Candy Apple is $20,000 and the losses are $30,000. $10,000 of the loss will therefore be suspended as it is more than his tax basis.
Of the remaining $20,000, a further $10,000 will be deducted due to his at-risk amount being $10,000 which means he can only be charged that $10,000.
As John is a limited partner in both Candy Apple and Red Tomato, this means that these are Passive incomes or losses for him and he can use then to offset one another. He will therefore use the $5,000 gained from Red Tomato to offset some of the losses from Candy Apple.
This leaves him with $5,000.