What is the function rule for the following situation? Rex paid $20 for a membership to the pool and pays $3.00 each time he goes to the pool. Let y equal the total cost, and x can be the number of times Rex goes to the pool.

The function rule for this situation is:

y = 3x + 20

where y is the total cost and x is the number of times Rex goes to the pool.