Let the total number of seventh grade students be x
Let the number of seventh grade students taking advanced math be k
3/8 of x were taking advanced math at the beginning of the year, i.e
![(3)/(8)\text{ of x}=(3)/(8)* x=(3x)/(8)](https://img.qammunity.org/2023/formulas/mathematics/college/x6288jxnbocowgmkorh23m547pu4rltk6u.png)
7 students dropped out by the end of the year, i.e
![(3x)/(8)-7=k](https://img.qammunity.org/2023/formulas/mathematics/college/3w4esqyii2visrrjuv95g2mtndcq8qdc8v.png)
If there were 140 students taking advanced math at the end of the year
![k=140](https://img.qammunity.org/2023/formulas/mathematics/college/82v8ng5sj7ma7mcrl8n0s4t35x9rrfphi3.png)
Substitute 140 for k into the derived expression to find x
![\begin{gathered} (3x)/(8)-7=k \\ (3x)/(8)-7=140 \\ \text{Collect like terms} \\ (3x)/(8)=140+7 \\ (3x)/(8)=147 \\ \text{Crossmultiply} \\ 3x=147*8 \\ 3x=1176 \\ \text{Divide both sides by 3} \\ (3x)/(3)=(1176)/(3) \\ x=392 \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/lb5u38ts43y7cdu06ry13lh2n2t9h8y8vb.png)
Hence, the total number of seventh grade students there is 392