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.

modulo_function2012-09-13T08:53:57Z

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.