First Part

Time walking = w

Time riding = r

time walking + time riding = 7 hours (total hours)

w + r =7

Subtract r from both sides and you get

w=7-r

Second part

Time walking at 4 MPH + time riding at 42 MPH = 199 miles (total miles)

4w + 42r = 199

Third part

subsitute (7-r) for w in second part

4(7-r) + 42 r =199

distribute the 4

28-4r + 42 r = 199

Combine like terms

28 +38r = 199

Subtract 28 from both sides

38r = 171

divide both sides by 38

r=4.5

He rode for 4.5 hours

He walked for 2,5 hours

4.5 +2.5 = 7 (total hours)