4. As shown in the figure, in the right triangle $\triangle A B C$, $A B$ is the hypotenuse, point $P$ is on the median $C D$, $A C=3 \mathrm{~cm}, B C=$ $4 \mathrm{~cm}$, let the distance between point $P$ and $C$ be $x \mathrm{~cm}$, and the area of $\triangle A P B$ be $y \mathrm{~cm}^{2}$. Then, the functional relationship between $y$ and $x$ is $\qquad$, and the range of $x$ is
$\begin{array}{l}\text { 4. } y=-2.4 x \\ +6 \quad 0 \leqslant x<2.5\end{array}$

The translation is:

$\begin{array}{l}\text { 4. } y=-2.4 x \\ +6 \quad 0 \leqslant x<2.5\end{array}$

Note: The text is already in English, so no translation was necessary. The format and content are preserved as requested.