Created
March 20, 2012 18:43
-
-
Save bbhoss/2139573 to your computer and use it in GitHub Desktop.
BMI Calculator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
calcBMI :: Float -> Float -> Float | |
calcBMI heightIn weightLbs = (weightLbs*703)/heightIn^2 | |
main = do | |
putStrLn "What is your weight in pounds?" | |
weight <- readLn :: IO Float | |
putStrLn "What is your height in inches?" | |
height <- readLn :: IO Float | |
putStrLn ("Your weight is " ++ show weight ++ "lbs. and your height is " ++ show height ++ "in.") | |
putStrLn ("Your BMI is " ++ show(calcBMI height weight)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment