Sarah visits an amusement park with an admissions cost of $24. Each ride costs $3. She does not buy any food or drink while she is there. If y represents the total she spends at the park and she takes x rides, which of the following is a function that represents her total spending? 

A. y=24x+3

B. x+y=27

C. y=3x+24

D. y=27x