Monday, February 3, 2014

Section 3.1: Numbers - Mathematical Functions




41036:  The area of a square is stored in a double variable named area.  Write an expression whose value is the length of the diagonal of the square.

Math.Sqrt(2*area)

41037:  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.

Math.Sqrt(length^2 + width^2)

2 comments:

  1. how do I solve:

    Use the ToString method with a format string to convert the double variable , pi to the string variable , s, in fixed point format and 4 digits of precision.

    ReplyDelete