-- FP1 lab exercises, 25/1

-- Exercise 1. 

-- Define a function that computes the average of three numbers.

average3 :: Float -> Float -> Float -> Float
average3 x y z = (x+y+z)/3


-- Exercise 2. 

-- Define a function that computes the hypotenuse
-- of a right-angled triangle from its catheti (legs).

hypo :: Float -> Float -> Float
hypo a b = sqrt (a^2 + b^2)


{-
*Main> average3 2 5 7
4.6666665
*Main> average3 2 2 2
2.0
*Main> hypo 3 4
5.0
*Main> hypo 3 1
3.1622777
*Main>   
-}
