Hello!
The independent variable is B) M-The number of months.
In an equation, the independent variable is the one that can be changed freely, and changing its value will change the dependent variable. In this case, the number of months can be changed freely, as the individuals can choose how many months they want to be members of the club, so M is the independent variable.
The total amount spent will change depending on how many months the person stays at the club, so A is the dependent variable.