So to solve this you can set up a ratio:
First we need to find out how many boys there are
5/8=x/24
then multiply 5 by 24 = 120
then divide by 8 which gives you 15 Boys out of the class
then since there are 24 students and 15 are boys subtract the two with gives you 9 girls.
this is assuming that everyone identifies as a male or female.