Answer: He bought 4 cupcakes and 12 donuts 
Explanation:
He bought three times as many donuts as cupcakes so we could represent that by the equation d= 3c where d is donuts and c is the cupcakes. 
If cupcakes also cost 50 cent and donuts cost a dollar each and he spent a total of 10 dollars then we could also represent that by the equation 
 0.50d + 1c = 10 
Now combine use the two equations and solve for d and c 
d= 3c 
0.50d + 1c =10 substitute d in the first equation into the second equation.
0.50(3c) + 1c =10 
1.5c + 1c =10 
2.5c = 10 
 c= 4 
In this case he bought a total of 4 cupcakes and to find the total of donuts that he bought we multiply that by 3 because he bought three times as much as that. 
d= 3 * 4 
d = 12