This is not the best way to solve, but it is the best way (in my opinion) to understand it.
Plan:
For these problems, we can make it easier by PRETENDING that the total number of people is 1000.
Solve:
Since the ratio of males to females is 3 : 2. Let us calculate the exact number of males to females using the information we have in our plan.
3 + 2 = 5
5x = 1000
x = 200
20 * 3 = 600 males
20 * 2 = 400 females
42% of males = 0.42 * 600 = 252 males
64% of females = 0.64 * 400 = 256 females
Add them up 508 people who voted to re-elect the senator.
Out of the 1000 people, 508 of them did. So the overall percent is 508/1000 = 0.508, or 50.8%