Final answer:
To find the total cost, subtract the number of students who didn't participate from the total number of students. Multiply the number of participating students by the cost per student to find the total cost.
Step-by-step explanation:
To find the total cost, we need to determine the number of students who participated in the race. Since all but 8 students participated, the number of students who participated in the race would be 39 - 8 = 31.
The total cost can be found by multiplying the number of students who participated by the cost per student. In this case, each student paid $6, so we multiply 31 by $6.
The total cost would be 31 * $6 = $186.