To solve for the prices of the cake (c) and the pie (p), we can use the given system of equations:
- \( c - p = 9 \) (Equation 1)
- \( 8c + 14p = 402 \) (Equation 2)
First, we can solve Equation 1 for \( c \):
\[ c = p + 9 \]
Now, substitute \( c \) in Equation 2:
\[ 8(p + 9) + 14p = 402 \]
Distributing the 8:
\[ 8p + 72 + 14p = 402 \]
Combining like terms:
\[ 22p + 72 = 402 \]
Now, subtract 72 from both sides:
\[ 22p = 330 \]
Next, divide by 22:
\[ p = 15 \]
Now that we have the price of a pie, we can find the price of a cake using Equation 1:
\[ c = p + 9 = 15 + 9 = 24 \]
Thus, the price of a cake is:
\[ \boxed{24.00} \]
So the answer is \( D. 24.00 \).