Write the Java expression for the following:
p3 + q4 − `1/2`r
p * p * p + q * q * q * q - (1 / 2) * r