Let the weight of the pan be \( p \) ounces and the weight of each egg be \( e \) ounces.
From the information given, we can set up two equations:
-
For the pan with four eggs: \[ p + 4e = 18 \]
-
For the pan with eight eggs: \[ p + 8e = 24 \]
Now, we can solve these equations. First, we can subtract the first equation from the second:
\[ (p + 8e) - (p + 4e) = 24 - 18 \]
This simplifies to:
\[ 4e = 6 \]
Dividing both sides by 4, we find:
\[ e = \frac{6}{4} = 1.5 \text{ ounces} \]
Now, we can substitute the value of \( e \) back into one of the original equations to find \( p \). Using the first equation:
\[ p + 4(1.5) = 18 \] \[ p + 6 = 18 \] \[ p = 18 - 6 = 12 \text{ ounces} \]
Thus, the weight of the pan is \( \boxed{12} \) ounces.