First, change all of your percentages to decimal points. Now we have 0.08, 0.17, and 0.75.
Now, take 40 and divide it by 0.08. You get 500, so 500 students were surveyed. 8% of 500 is 40.
Now take 500 and multiply it by 0.17 and you get 85. 85 students drive.
Take 500 and multiply it by 0.75 and you get 375, so 375 students take the bus.
You can write your fractions using the number that walked, drove, or took the bus over the amount surveyed.