ICSE Class 10 Computer Applications Question 6 of 14

Mathematical Library Methods — Question 6

Back to all questions
6
Question

Question 6

Write the following as Java expressions:

i. x2+5y33\sqrt[3]{x^2 + 5y^3}

Answer

Math.cbrt(x * x + 5 * y * y * y)

ii. x+y\lvert x + y\rvert

Math.abs(x + y)

iii. x3+y22xy\lvert x^3 + y^2 -2xy\rvert

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

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

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

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

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

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

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

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

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

viii. (b+b24ac)2a\dfrac{(-b + \sqrt{b^2 - 4ac})}{2a}

(-b + Math.sqrt(b*b - 4*a*c)) / (2*a)

ix. 1LCR24C24\sqrt[4]{\dfrac{1}{LC} - \dfrac{R^2}{4C^2}}

Math.pow((1 / L*C) - ((R*R)/(4*C*C)), 1/4)