You buy a car wash at the gas station for $5 in addition to gas. The cost per gallon for gas is $3.10. If you have $40, write and solve a linear equation in slope-intercept form to find the number of gallons of gas you can afford.