To determine the total class the whole class spent, you just have to simply add the individual costs of the three books. Using parenthesis, the solution can be written in the following two ways:
($15 + $9) + $12 = $36
$15 + ($9 + $12) = $36
No matter where you put the parenthesis, the final answer doesn't change. This is because of the Commutative Property of Addition. The order does not matter.