What is the rate for...

y=-x+3
And...

0 days =40 dollars...
1 day =35 dollars....
4 days =20 dollars...
6 days= 10 dollars...

no idea what you mean with -x+3, but the table has the rule

y = 40-5x