For the 1st case: It was stated that the initial value is $15,000, salvage value is $4,000 and the useful life is 7 years. Therefore the depreciation per year assuming straight line depreciation is:
Depreciation = ($15,000 - $4,000) / 7 years
Depreciation = $1,571.43 / year
Since this 1st case covered 2 years, then the value after 2 years is:
Value after 2 years = $15,000 – ($1,571.43 / year) * 2 years
Value after 2 years = $11,857.14
For the 2nd case: After 2 years the useful life is adjusted and there would only be a remaining life of 3 more years whie the salvage value is still at $4,000. The depreciation after 2 years is:
Depreciation = ($11,857.14 - $4,000) / 3 years
Depreciation = $2,619 / year
Therefore the depreciation for the third year is $2,619. While the remaining value after 3 years is $11,857.14 - $2,619 = $9,238.14