Here, we have a fixed parking cost and a variable parking lot that is a function of the time spent in the lot. Our approach is to create an algebraic relationship and then slot in our variable vales to solve.
Let c represent the cost of parking.
Let t represent the time car spent in the lot.
We then have:

To calculate the cost of 6 hours in the lot, we have:

$17 for a 6 hour packing.
Cost for tt hours.

Cost for tt hours = c = 5+2(tt)