Computer Science, asked by AvnishPandey, 1 month ago

Write the Java expression for:- a² + b² / 2ab​

Answers

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

Question given:

  • Write the Java expression for a² + b² / 2ab

What does we have to do:

  • We have to create a Java expression for the given mathematical expression

Basic understanding:

  • Math.pow : This returns the value of the first argument raised to the power of second argument. First number is called base number and second argument is called exponent.

Forming Answer:

  • Here first argument is "a" whereas second argument is "2" to which it is raised. First number is "a" so it is base number and second number is "2" so it is called exponent.
  • And in "b²" first argument is "b" whereas second argument to which it is raised is "2". First number is "b" so it is base number and second number is "2" so it is called exponent.

Here base number is a and b and the exponent is 2 in both.

The syntax and return type would be:

  • Syntax - Math.pow(x,y)
  • Return type - double

So the answer would be,

  •   \dag \: \underline{ \boxed{\sf\footnotesize{ {\dfrac{((Math.pow(a,2) \:  +  \:(Math.pow(b,2)) }{(2.0  \: * \:  a \: * \: 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.
  • Math.max gives largest of two arguments
  • Math.min gives smallest of two arguments.

More similar questions:

  • https://brainly.in/question/42140095?utm_source=android&utm_medium=share&utm_campaign=question
  • https://brainly.in/question/30816677?utm_source=android&utm_medium=share&utm_campaign=question
  • https://brainly.in/question/18010374?utm_source=android&utm_medium=share&utm_campaign=question
Similar questions