Computer Science, asked by sharan2334, 1 month ago

write equivalent java expression for |a5 - root b|

Answers

Answered by mayankjangde08
4

Answer:

Write a Java expression for the following:

5/10+ x5 + 4/ bx3

Ans.

5.0/10.0 + Math.pow(x,5) + 4.0/ b * Math.pow(x, 3)

Write the Java expression for

ax5 + bx3 + c

Ans.

a * Math.pow(x, 5) + b * Math.pow(x, 3) + c

Answered by SƬᏗᏒᏇᏗƦƦᎥᎧƦ
10

Corrected question :

Write equivalent java expression for,

  • | a⁵ - √b |

Explaination :

  • Here we would be using pow method, sqrt method and abs method . pow method would be used because it returns the value of first argument raised to second argument, here first argument is a and second argument is 5 to which it is raised.
  • Whereas in the second condition sqrt method will be used because the sqrt is being returned of b
  • And abs method will be used because the whole expression is returning the absolúte value of the argument

Final Answer :

  • Math.abs (Math.pow (a , 5) - Math.sqrt (b))

Additional Information :

  • Method is a named block of a códe in a class. It is executed within a defined set of instructions.
  • Methods and variables of math class are defined as static members.
  • Java.lang package contains classes and interfaces which are fundamental to Java programming language.
  • The math class of java.lang package contains generic mathematical functions including some geometric and trigonometric function.
  • Math.cbrt returns cube root of a double value.
  • Math.ceil returns smallest integer which is greater or equal to the argument.
  • Double datatype is used if a output comes in decimal.
  • Math.max method gives us the largest of two given arguments
  • Math.min method gives us the smallest of two given arguments

More similar questions :

https://brainly.in/question/20782361

https://brainly.in/question/20735428

https://brainly.in/question/35751426

https://brainly.in/question/24154252

https://brainly.in/question/20191304

Similar questions