40%. To find the percentage of the total that Rafael spent on fruit, you can use the following formula:
\[ \text{Percentage spent on fruit} = \left( \frac{\text{Amount spent on fruit}}{\text{Total amount spent}} \right) \times 100 \]
In this case:
\[ \text{Percentage spent on fruit} = \left( \frac{8}{20} \right) \times 100 \]
\[ \text{Percentage spent on fruit} = 0.4 \times 100 \]
\[ \text{Percentage spent on fruit} = 40\%
Therefore, Rafael spent 40% of the total amount on fruit.