The average monthly bill for the first 4 months is $x.
The average monthly bill for the last 2 months is $24.
To find the average monthly bill for all 6 months, we can use the formula:
average monthly bill = (total bill) / (number of months)
The total bill for the first 4 months is 4 * $x = $4x.
The total bill for the last 2 months is 2 * $24 = $48.
The total bill for all 6 months is $4x + $48.
The average monthly bill for all 6 months is ($4x + $48) / 6.
We are given that the average monthly bill is $28, so we can write: ($4x + $48) / 6 = $28.
Multiplying both sides by 6, we get: $4x + $48 = $168.
Subtracting $48 from both sides, we get: $4x = $120.
Dividing both sides by $4, we get: x = $30.
The value of x is $30.
#### 30
The answer is: 30
Below is a math problem. Provide a detailed, step-by-step solution.

### Problem:
A family's water and electricity bills average $x a month for the first 4 months and $24 a month for the last 2 months. If the family's bills were averaged over all 6 months, what would the average monthly bill be?
If we know the answer to the above question is 28, what is the value of unknown variable x?

### Answer:
