The heights of 80 saplings were measured and grouped in the following table:
Class interval (cm): 20–29 | 30–39 | 40–49 | 50–59 | 60–69
Frequency: 10 | 3x | 2x−2 | x+4 | 8
If the total number of saplings is 80, calculate the value of x and hence complete the frequency table.