Final answer:
There are 20 males and 14 females in the class.
Step-by-step explanation:
To find the number of males and females in the class, let's set up an equation. Let's say the number of males is x.
Since the number of females is 6 less than the number of males, we can represent the number of females as x-6.
The total number of students is 34, so we have the equation x + (x-6) = 34.
Solving this equation, we find that x = 20, which is the number of males, and x-6 = 20-6 = 14, which is the number of females.