HHow many pupils are there in a class if two pupils remain after four rows of seats are filled, and nine pupils remain after three rows of seats are filled?

a. 21
b. 22
c. 28
d. 30
e. 32

please answer and explain

If there are 9 left over from 3 rows and 2 left over from 4 rows, each row must seat 9-2 = 7 pupils

So, 7*4 +2 = ?

Or, 7*3 +9 = ?

To find the number of pupils in a class, we need to solve a system of linear equations based on the given information.

Let's assume the number of pupils in a row is 'x' and the number of rows is 'y.'

According to the first condition, two pupils remain after four rows of seats are filled. This can be represented as:

4x + 2 = total number of pupils

According to the second condition, nine pupils remain after three rows of seats are filled. This can be represented as:

3x + 9 = total number of pupils

To find 'x,' we can set up an equation by combining the two conditions:

4x + 2 = 3x + 9

By subtracting 3x from both sides, we get:

x + 2 = 9

Subtracting 2 from both sides, we have:

x = 7

Now that we know 'x,' we can substitute it into either of the original conditions to find 'y.' Let's use the second condition:

3(7) + 9 = total number of pupils
21 + 9 = total number of pupils
30 = total number of pupils

Therefore, there are 30 pupils in the class. So, the correct answer is option d: 30.