The Body Mass Index (BMI) is a number that allows evaluating a person’s corpulence by relating their mass to their height. It was developed by the Belgian Adolphe Quételet while elaborating his system of “social physics" between the years 1830 and 1850 and is also known as the Quételet Index. Its formula is where is the person’s mass (in kilograms) and their height (in meters).
Its interpretation (applicable only to adults) is as follows:
| BMI | Interpretation |
|---|---|
| less than 18 | underweight |
| 18 to 25 | normal corpulence |
| 25 to 30 | overweight |
| 30 to 40 | obesity |
| more than 40 | morbid obesity |
Write a Haskell program to interpret the body mass index of different people.
The input is organized by lines. Each line contains three elements separated by spaces: name, weight, and height. The last line is special and contains only an asterisk.
For each input data, write their name and the interpretation of their BMI.
To solve this problem in Haskell, write a main function and choose the GHC compiler.
Input
Joan 76 1.80 Merce 66 1.50 Felip 100 2.01 Ramon 90.9 1.70 Anna 40 1.70 Maria 120 1.60 *
Output
Joan: corpulencia normal Merce: sobrepes Felip: corpulencia normal Ramon: obesitat Anna: magror Maria: obesitat morbida