Let Y = total cost of both schools.
The total cost would be ( number of credits at Westside x 98) + (number of credits at Pinewood x 115).
The total number of credits he is taking is 14.
If w is the number of credits at Westside, then for Westside you have 98w ( $98 times the number of credit hours)
The equation is now y = 98w + (number of credits at Pinewood x 115).
The number of credit hours at Pinewood would be the total credit hours 14 minus the credit hours at Westside w, so you have 14-w, which needs to be multiplied by the cost at Pinewood.
The equation is now y = 98w + 115(14-w)
This can be simplified using the distributive property to:
Y = 98w + 1610 - 115w
Y = -17w + 1610