Final answer:
The number of boys in the class is 18.
Step-by-step explanation:
To determine the number of boys in the class, we first calculate the total number of students. We are given that 40% of the students are girls, and we know that there are 12 girls. So, to find the total number of students, we can set up the following proportion: 40% is to 100% as 12 is to the total number of students. Solving this proportion, we find that the total number of students is 30. Since there are 12 girls, the remaining students must be boys. Therefore, the number of boys in the class is 30 - 12 = 18.