1. Murali Suriar
  2. haskell

Commits

Murali Suriar  committed 02b349c

Hello.

  • Participants
  • Parent commits e0da8b6
  • Branches fooo

Comments (0)

Files changed (1)

File lyah/scratch.hs

View file
  • Ignore whitespace
                         else doubleMe x
 
 doubleSmallNumber' x = (if x > 100 then x else doubleMe x) + 1
+
+fac :: Int -> Int
+fac n = product [ 1 .. n ]
+
+circumference :: Float -> Float
+circumference r = 2 * pi * r
+
+
+bmiTell :: (Fractional a, Ord a) => a -> a -> String
+bmiTell weight height
+	| (bmi weight height) <= skinny = "Skinny."
+	| (bmi weight height) <= normal = "Normal."
+	| (bmi weight height) <= fat = "Fat."
+	| otherwise = "Monstrous!"
+	where bmi weight height = weight / height ^ 2
+        skinny = 18.5
+        normal = 25.0
+        fat = 30.0