Let the proportion of males in the school be given as p(Male) = 20 per 100 students
Total proportion of females in the school be given as p(Female) = 80 per 100 students
Given that male students who wear glasses are p(Glasses|Male) = 40 males per 100 male students
So total proportion of male students in school who wear glasses are p(Male who wear glasses) = 40/100 * 20/100 = 800/10000 = 8/100 = 0.08; that is 8 male students per 100 students wear glasses.
Similarly given that proportion of female students who wear glasses is p(Glasses|Female) = 30/100 which means 30 females per 100 female students.
So proportion of female students who wear glasses in school are p(Females who wear glasses) = 30/100 * 80/100 = 2400/10000 = 0.24 that is 24 female students out of 100 students wear eyeglasses
So total proportion of students in the school who wear eye glasses are
p(Glasses) = 0.08 + 0.24 = 0.32
that is 32 out of 100 students in school wear eyeglasses.
So 32% students overall wear eye glasses.