ICSE Class 9 Computer Applications Question 3 of 16

Mathematical Library Methods — Question 3

Back to all questions
3
Question

Question 3

Write the following as Java expressions:

i. x3y22xy\lvert x^3 - y^2 -2xy\rvert

Answer

Math.abs(Math.pow(x, 3) - Math.pow(y, 2) - 2*x*y)

ii. π6(z42π)\dfrac{\pi}{6}(z^4 - 2\pi)

Math.PI / 6*(Math.pow(z, 4) - 2*Math.PI)

iii. z2π3\sqrt[3]{z^2 - \pi}

Math.cbrt(z*z - Math.PI)

iv. x3y34\sqrt[4]{x^3 - y^3}

Math.pow(x*x*x - y*y*y, 1/4)

v. amountrate11(1+rate)n\cfrac{amount*rate}{1 - \cfrac{1}{(1 + rate)^n}}

(amount*rate) / (1 - (1 / Math.pow(1+rate, n)))