Let's solve the problem step by step. Let's assume the number of math majors in the class is "2x" and the number of students who are not math majors is "5x".
According to the given information, the initial ratio of math majors to non-math majors is 2:5. Therefore, we have:
Math Majors: 2x
Non-Math Majors: 5x
Next, it states that if 2 more math majors were to enter the class, the ratio would be 1:2. This means that the new ratio of math majors to non-math majors would be 1:2. Therefore, we have:
Math Majors: 2x + 2
Non-Math Majors: 5x
Now, we can set up an equation using the ratios:
(2x + 2) / (5x) = 1 / 2
To solve this equation, we can cross-multiply:
2(2x + 2) = 5x
4x + 4 = 5x
4 = 5x - 4x
4 = x
Now, we can substitute the value of x back into the original equations to find the total number of students in the class:
Total Students = Math Majors + Non-Math Majors
Total Students = 2x + 5x
Total Students = 7x
Total Students = 7 * 4
Total Students = 28
Therefore, there are 28 students in the class.
The correct answer is (D) 28.