Check the final answer first, then review the worked steps.
$$\frac{r}{z} = \frac{h}{a^3} \implies ra^3 = zh \implies z = \frac{ra^3}{h}$$