< previous page page_166 next page >

Page 166
Assumptions: The two lengths are positive floating point numbers (checking for erroneous data is not done).
Main Module                    Level 0
Get data
Print data
Find length of hypotenuse
Print length of hypotenuse

Get Data                    Level 1
Print Enter the lengths of the two sides.
Read lengthOfA, lengthOfB

Print Data
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

 
< previous page page_166 next page >