Step 1 :Let's denote M as the cost of the monthly membership, C as the cost per class, T as the total cost, and N as the number of classes. From the problem, we know that M = $30 and C = $5.
Step 2 :The total cost for the monthly membership is always $30, so we have the equation M = T.
Step 3 :The total cost for the walk-ins is the cost per class times the number of classes, so we have the equation C * N = T.
Step 4 :We can solve these two equations by substitution to find the values of T and N.
Step 5 :Substituting M = 30 into the first equation, we get T = 30.
Step 6 :Substituting C = 5 into the second equation, we get N = T/5.
Step 7 :Final Answer: The total cost is \(\boxed{30}\) dollars and the number of classes is \(\boxed{6}\).