Let's let \( N \) represent the total number of students Mr. Gumdrop surveyed. To find \( N \), we will set up equations based on the percentages provided for the different preferences.
8th Grade
For the 8th grade:
- Candy: 27% of \( N \)
- Chips: 16% of \( N \) (We know that there are 5 students who like chips)
- Fruit: 10% of \( N \)
From the chips preference, we note that: \[ 0.16N = 5. \] Now we will solve for \( N \): \[ N = \frac{5}{0.16} = 31.25. \]
9th Grade
For the 9th grade:
- Candy: 20% of \( N \)
- Chips: 10% of \( N \)
- Fruit: 17% of \( N \)
These percentages do not influence the total \( N \) calculation based on our earlier findings for the 8th grade, but we can check if rounding \( N \) to the nearest whole number adds up correctly to the preferences.
Final Calculation
Rounding \( N \) to the nearest whole number gives: \[ N \approx 31. \]
Thus, the total number of students Isabella surveyed is approximately:
\[ \boxed{31}. \]