A teacher has fewer than 200 sweets. She wants to give each pupil in her class an equal number of sweets. If she gives each pupil 2 sweets, she will have 70 sweets left over; if she gives 4 each, she will need 10 more sweets. How many pupils are there in the class? How many sweets does the teacher have?

number of sweets --- s , where s < 200

number of students -- x

case1 : 2x + 70=s
case2 : 4x - 10 = s

4x - 10 = 2x+70
2x = 80
x = 40

then s = 80+70 = 150
( or x = 4x-10 = 150)

There are 150 sweets and 40 students

To solve this problem, we can use algebraic equations. Let's say the number of pupils in the class is "x" and the number of sweets the teacher has is "s".

According to the problem:

1) If each pupil receives 2 sweets, the teacher will have 70 sweets left over.
Mathematically, we can write this as: s - (2 * x) = 70

2) If each pupil receives 4 sweets, the teacher will need 10 more sweets.
Mathematically, we can write this as: s - (4 * x) = -10

Now we have a system of two equations that we can solve to find the values of "x" and "s".

Let's start by solving these equations simultaneously.

Equation 1: s - 2x = 70
Equation 2: s - 4x = -10

To eliminate "s", we can subtract Equation 2 from Equation 1:
(s - 2x) - (s - 4x) = 70 - (-10)
s - 2x - s + 4x = 70 + 10
2x = 80

Dividing both sides of the equation by 2, we get:
x = 40

So, there are 40 pupils in the class.

Now, to find the number of sweets the teacher has, we can substitute the value of "x" into either Equation 1 or Equation 2.

Let's use Equation 1:
s - 2x = 70
s - (2 * 40) = 70
s - 80 = 70
s = 150

Therefore, the teacher has 150 sweets.

To summarize:
- There are 40 pupils in the class.
- The teacher has 150 sweets.