In triangle ΔXYZ, XY = 15, YZ = 21, and XZ = 27. What is the measure of angle Z to the nearest degree?

A. 34º
B. 39º
C. 56º
D. 117º

AAAaannndd the bot gets it wrong yet again!

If we label the sides in the usual manner, we get
z^2 = x^2 + y^2 - 2xy cosZ
15^2 = 21^2 + 27^2 - 2*21*27 cosZ
cosZ = 5/6
Z ≈ 33.56°

Using the Law of Cosines, we have:

$\cos Z = \frac{15^2 + 27^2 - 21^2}{2\cdot15\cdot27} = \frac{801}{810}.$

Using a calculator, we find $\cos^{-1} \left(\frac{801}{810}\right) \approx 38.8^\circ.$ Rounded to the nearest degree, the answer is $\boxed{\textbf{(B) }39^\circ}.$