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.

JAVA help!!! simple expression?

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.

1 Answer

Relevance
  • 9 years ago
    Favorite Answer

    The diagonal of a rectangle that's w wide and l long is:

    double diag = Math.sqrt( w*w + l*l );

    That's simply the Pythaogorean formula.

Still have questions? Get your answers by asking now.