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.

LANGUAGE: JAVA

CHALLENGE:

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.

SOLUTION:

The Bad News: The content you are trying to access is only available to members.

The Good News: You too can be a member, simply Click Here.

Already a member?

Posted in ,

2 Comments

  1. bryan osborne on February 16, 2016 at 2:43 pm

    sqrt(width*width + length*length)

  2. Jeff on February 24, 2016 at 7:46 pm

    Correct answer for the question:

    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.

    is:

    sqrt(pow(length,2) + pow(width,2))

Leave a Comment

You must be logged in to post a comment.