|
|
|
|
|
|
|
Assumptions: The two lengths are positive floating point numbers (checking for erroneous data is not done). |
|
|
|
|
|
|
|
|
Get data
Print data
Find length of hypotenuse
Print length of hypotenuse |
|
|
|
|
|
|
|
|
|
|
Print Enter the lengths of the two sides.
Read lengthOfA, lengthOfB |
|
|
|
|
|
|
|
|
|
|
|
Print blank line
Print The length of side A is , lengthOfA
Print The length of side B is , lengthOfB |
|
|
|
|
|
|
|
|
|
|
Find Length of Hypotenuse |
|
|
|
|
|
|
|
|
|
Compute sum of squares
Set hypotenuse = sqrt(sumOfSquares) |
|
|
|
|
|
|
|
|
|
|
Print Length of Hypotenuse |
|
|
|
|
|
|
|
|
|
Print The length of the hypotenuse is , hypotenuse |
|
|
|
|
|
|
|
|
|
|
Compute Sum of Squares Level 2 |
|
|
|
|
|
|
|
|
|
Set sumOfSquares = lengthOfA * lengthOfA + lengthOfB * lengthOfB |
|
|
|
|
|
|
|