Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

simple JAVA expression help!?

The length of a rectangle is stored in a double variable named length , the width in one named width . Write an expression whose value is the length of the diagonal of the rectangle.

this is what i put:

double diagonal=sqrt((length*length)+(width*width));

but its wrong

3 Answers

Relevance
  • 9 years ago
    Favorite Answer

    It should be: double diagonal= Math.sqrt((length*length)+(width*width));

  • 4 years ago

    A recursive descent parser supplies the shortest and maximum elementary code. you basically would desire to define expressions expression :=: expression operand expression Your application keeps recognizing expressions till it properly-knownshows a term (like "12") and then evaluates up the tree. Algortithms for recursive descent parsers are rather previous (because of the fact the 70's) and are available a great style of languages. between the 1st obtainable e-e book is in Pascal via Niklaus Wirth, the inventor of Pascal. The identify of that e book: courses = Algortithms + records structures. some issues in no way exchange.

  • 9 years ago

    Why is that wrong ? The formula looks right to me.

Still have questions? Get your answers by asking now.