Okay, this one is easiest if you put real numbers to it, and make a table.
Let's say there are 400 students total. I picked this number because all of both sets of percentages are in 5% increments. As long as the number of students in each class are divisible by 20, they will give an even whole number of students planning med school. To guarantee an even multiple of 20 in the each class, given the classes are 5% increments, you multiply by 20 again and get 400 as your total in the class. 4000 or 100,000 would work too, but 400 is the minimum.
Freshmen = 40% * 400 = 160
Med school yes = 50% * 160 = 80,
No is 160 -80 = 80
Sophomore = 15% * 400 = 60
Med School yes = 35% * 60 = 21,
No is 60 - 21 = 39
Junior = 10% * 400 = 40
Med School Yes = 20% * 40 = 8
No = 40 - 8 = 32
Senior = 35% * 400 = 140
Med school yes = 25% * 140 = 35,
No = 140 - 35 = 105
Make a table like this (hard to line up right on this forum) then add a total line at the bottom
FR 160 80 80
SO 60 21 39
JU 40 8 32
SE 140 35 105
TO 400 144 256
The answer to the first problem is to add up all the students that plan to go to med school (144), then divide by the total number of students in the school (400).
The answer to the second question is to divide the number of freshman who plan to go to medical school (80) by the total number of students who plan to go to medical school (144). This is because, if we've already picked a student who plans to go to medical school, he must be one of those 144 students, and 80 of them are freshmen.
You could have done the entire problem with percentages, and it would have come out the same, but I find that using whole numbers makes it easier to grasp. Thus, I gave you the key to picking the original number of students to use.