Question 1129638
Amanda is 5 years older than Peter 
<pre>
A = P+5
</pre>
and Sam is 3 years younger than Peter.
<pre>
S = P-3
</pre>
If the sum of their ages is 50, 
<pre>
A+P+S = 50

Substitute (P+5) for A, and (P-3) for S in A+P+S = 50:

(P+5)+P+(P-3) = 50

Solve for P, that's Peter's age.

Substitute what you get for P in A = P+5 to get Amanda's age.

Substitute what you get for P in S = P-3 to get Peters's age.

Edwin</pre>