To solve this problem, we need to set up a system of equations based on the given information.
Let's assume that in the first semester, the number of students in art class is 2x, and the number of students in gym class is 7x.
In the second semester, the number of students in art class is 5y, and the number of students in gym class is 4y. We also know that the number of students in art class in the second semester is 75.
So, we can set up the equation: 5y = 75
To solve for y, we divide both sides of the equation by 5:
y = 75/5 = 15
Now that we know y, we can substitute it back into the equation for the first semester to find the number of students in art class and gym class:
Number of students in art class in the first semester = 2x = 2 * 15 = 30
Number of students in gym class in the first semester = 7x = 7 * 15 = 105
Therefore, there were 30 students in art class and 105 students in gym class during the first semester.
Note: It is important to remember to set up equations based on the given information and solve for the unknown variables to find the answer to the question.