To start off, you have to set up the problem as 40 percent over 100 percent equals 12 over x. Next, you multiply 100 and 12. You should get 1,200. Then, you divide 1,200 by 40. You will get 30. 30 is the amount of the whole class. Finally, you should subtract 30 and 12. You will then have your answer, 18.
The formula is given in the middle. You are supposed to insert the value of x into this formula to find the value of y (like in the first given example):