David and Alex have a total of 25 years. 
(1)     D + A = 25
John is 10 years older than David. 
(2)     J = D + 10
 
5 years from now, John will be 16 years old. 
(3)     J + 5 = 16
How old is Alex?
Solve (3)
       J + 5 = 16
           J = 11
Substitute 11 for J in (2)
       J = D + 10
      11 = D + 10
       1 = D
Substitute 1 for D in (1)
       D + A = 25
       1 + A = 25
           A = 24
Alex is 24.
---------------
Checking:  A = 24, D = 1, J = 11 
David and Alex have a total of 25 years. 
That checks because 1 + 24 = 25
John is 10 years older than David. 
That checks because 11 = 1 + 10
How old is Alex if 5 year from now, John will be 16 years old?
That checks because 11 + 5 = 16.
Edwin