Java Expression
Java Expression
Vab +cd
Answer
+
Math. cbrt(a * b C *
d)
Question 2
1
--r
2
Answer
Question 3
-b + b 4ac
2a
Answer
0.05 - 2y
(x- y)
Answer
Question 5
Vmn +Vm+n)
Answer
Math.sqrt (m * n) + Math.cbrt (m + n)
Question 6
3 2
4
(a + b) 5
ab
Answer
3
(B' + c)
Answer
+ Math.pow(c,3)))
Question 8
Va +b
Answer
Question 9
Va+b + cß
3
Answer
V3x + x?
(a + b)
Answer
Question 11
z= x°+y
Answer
= Math.pow(x,3) + Math.pow(y,3) -
y / Math.pow (z,3)
Question 12
1 3
+
Va b
Answer
g =1 / Math. sqrt (a + b) + 3 /
Math. pow(c,2)
1. Write the equivalent Javasyntax for the
following expression:
0.05 - 2y
X- y
Ans:a =(0.05 -2 * Math.pow(y, 3))/(x-y);
2. Write a Java expression for:
(a+b).n
V3 + b
Ans: Math.pow((a+b),n)/Math.sqrt(3)+b)
3. Write a Java expression for:
V2as + u2
Ans: Math.sqrt(2*a*s + Math.pow(u, 2):
4. Write a Java expression for:
cos X+ a+ b2
Ans: Math.cos(x) + Math.sqrt(Math.pow(a,2) +
Math.pow(b,2);
5. Write a Java expressionfor the following
mathematical operation:
z=x°+y3.3Y
Ans: z = Math.pow(x,3) + Math.pow(y,3) -(x*y)/z;
6. Write an expression in Java for:
sin x + ax + bx +c
Ans: Math.sin(x) + Math.sqrt(a*Math.pow(x,2) +
b*x+ c);
5. Write a Java expressionfor the following
mathematicaloperation:
Xy
z=x® +y° Z
Ans: z = Math.pow(x,3) + Math.pow(y,3) - (x*y)/z;
6. Write an expression in Java for:
sin x + vax + bx +c
Ans: Math.sin(x) + Math.sqrt(a*Math.pow(x,2) +
b*x+ c);
7. Write the corresponding Java expression for
the folloiwng:
Ans: Math.sqrt((Math.pow(a,5) +
Math.pow(b,5))/9):
8.Write the expression for the absolute value of
V2x° /3y4
Ans: Math.abs(Math.sqrt(2 *Math.pow(x,3) /3 *
Math.pow(y,4)));
9. Write aprogram code to evaluate log(vx + yß
Iy)
Ans: Math.log(Math.sqrt(Math.pow(x,2) +
Math.pow(y,3)) / y);
10. Write an expression in Java for:
Z= 5x3+2y
X+y
Ans: z = (5* Math.pow(x,3) + 2 *y) / (x + y);