I am working on the following problem:

I'm having a hard time putting all of this information together:
The cost of the maintenance is $Z = X + Y$, where $X$ is the cost of the first machine and $Y$ is the cost of the second machine.
The payment $T$ by the insurer is $Z$ if $0 \leq Z \leq 6000$ and $6000$ if $Z > 6000$.
$$ T(Z) = \left\{ \begin{array}{lr} Z & \text{if } 0 \leq Z \leq 6000\\ 6000 & \text{if } Z > 6000 \end{array} \right. $$
We want to find $E[T(Z)] = T(Z)\cdot Pr[T(Z)].$
From here I am uncertain about how to proceed. I know that a uniform random variable on $[0, 4000]$ has expected value $\frac{4000}{2} = 2000$. This has a probability of $\frac{1}{3}$ of occurring.
I would think $E[X] = E[Y] = \frac{4000}{6}$, and so $E[Z] = \frac{4000}{3}$.
I am just unsure of how to factor in what the insurer is actually paying.
The probability of $(0,0)$ occurring is $\frac23\cdot\frac23$; the probability of $(0,y)$ occurring, for $0<y\le4000$, is $\frac23\cdot\frac13\cdot\frac{dy}{4000}$ (and similarly for $(x,0)$); the probability of $(x,y)$ occurring, for $0<x,y\le 4000$, is $\frac13\cdot\frac13\cdot\frac{dx}{4000}\cdot\frac{dy}{4000}$. Therefore the expectation is $$ \frac49\cdot0 + \int_0^{4000} \frac{y\,dy}{18000} + \int_0^{4000} \frac{x\,dx}{18000} + \int_0^{4000} \int_0^{4000} \frac{\min\{x+y,6000\}\,dx\,dy}{12000^2}. $$ Solving this calculus problem (splitting the last integral at the line $x+y=6000$) gives the answer $\frac{35750}{27} \approx 1324.07$.