there are 160 people in the restaurant
40%of 50 is 20:
[tex] \frac{50}{100} = \frac{x}{40} \\ x = \frac{40 \times 50}{100} = \frac{2000}{100} = 20[/tex]
the rest of the tables seat 4 people:
[tex]50 - 20 = 30[/tex]
so the number of people in the restaurant is 160
[tex]20 \times 2 = 4 0 \\ \\ 30 \times 4 = 120 \\ \\ 120 + 40 = 160[/tex]
good luck