Answer:
28 students
Step-by-step explanation:
Let x be the number of girls in the class. There were two more boys than girls in her class, then the number of boys is x + 2.
Mrs. Awesome gave each boy as many jelly beans as there were boys in the class, so each of x + 2 boys got x + 2 jelly beans, so
Number of boys = x + 2
Number of jelly beans each boy got = x + 2
Total number of jelly beans all boys got = (x + 2)(x + 2)
Mrs. Awesome gave each girl as many jelly beans as there were girls in the class, so each of x girls got x jelly beans, so
Number of girls = x
Number of jelly beans each girl got = x
Total number of jelly beans all girls got = (x)(x)
Hence,
Total number of jelly beans class got = (x + 2)(x + 2) + (x)(x)
Mrs. Awesome brought 400 jelly beans, and when she finished, she had six jelly beans left, so she gave 400 - 6 = 394 jelly beans to the calss.
So,

Number of girls cannot be negative, so x = 13, x + 2 = 15 and total number of students is 13 + 15 = 28