The solution requires a picture. Draw a large circle. This represents the number of students, 40.
Inside the big circle draw three interlocking circles representing airplane, boat and train (A, B, T).
You should be able to identify 7 regions formed by the interlocking circles. An 8th region is the area inside the big circle but outside the three others:
a. A only users (4)
b. B only users
c. T only users (3)
d. A and B users but not T
e. B and T users but not A
f. A and T users but not B
g. A, B and T users (x)
h. Not using any transport (x)
The numbers in brackets represent the known numbers of students in the various regions. Now we can put in other numbers.
a=4; c=3;
a+b+c+d+e+f+g+h=40; b+d+e+f+g+h=40-3-4=33 (because we know a and c);
a+d+f+g=17; d+f+g=13;
b+d+e+g=28; f+h=5;
c+e+f+g=10; e+f+g=7; d-e=6;
d+g=12; so f=13-12=1; h=5-1=4;
b+d+e+g+h=32; e+g=6; c+f=4; b+d=22;
g=h=4; b+d+e=24; e=24-22=2; d=6+2=8; b=22-8=14.
We have all the values a to h. Users of all three modes is g=4. Those using the boat only is b=14.
(a,b,c,d,e,f,g,h)=(4,14,3,8,2,1,4,4)