Answer:
Let x be the first group of students in a class and y be the second group of students in the class.
As per the statement:
As, the teacher separated her class of twenty-eight students in two groups.
⇒ x+y = 28 ......[1]
Also, one group has 4 more than twice as many as the other group.
⇒ x = 4 + 2y ......[2]
Now, substitute the equation [2] in [1]; we have

Combine like terms;
4 + 3y = 28
Subtract 4 from both sides we get;

Simplify:
3y = 24
Divide by 3 to both sides we get;

Simplify:
y = 8
Now, substitute the value of y in equation [2] to solve for x;

or
x = 20
therefore, the number of students in each group are 20 and 8.