ICSE Class 10 Computer Applications Question 19 of 26

Operators in Java — Question 19

Back to all questions
19
Question

Question 19

Write the Java expressions for the following:

i. (a + b)2 + b

Answer

Math.pow(a+b, 2) + b

ii. a2 + b2

a * a + b * b

iii. z = x3 + y3 + (xy) / 3

z = Math.pow(x, 3) + Math.pow(y, 3) + x * y / 3

iv. f = a2 + b2 / a2 - b2

f = (a * a + b * b) / (a * a - b * b)

v. z = ab + bc + ca / 3abc

z = (a * b + b * c + c * a) / (3 * a * b * c)

vi. 0 <= x <= 50

x >= 0 && x <= 50

vii. a = (0.05 - 2y3) / x - y

a = (0.05 - 2 * y * y * y) / (x - y)

viii. (a + b)n / √3 + b

Math.pow(a+b, n) / (Math.sqrt(3) + b)

ix. ax + by / ∛x + ∛y

(Math.pow(a, x) + Math.pow(b, y)) / (Math.cbrt(x) + Math.cbrt(y))