Hi Alain
Here is a little perl program I wrote. It's a bmi calculator. You provide your weight in kg and it tells you your weight in imperial units and your bmi value. It uses the bmi weight range definitions (underweight, normal weight, etc) provided here:
https://www.nhlbi.nih.gov/health/educational/lose_wt/BMI/bmicalc.htm
Synopsis.
bmi [-c] [-v] [-t] <weight in kg>
Options.
-c: convert weight to imperial units only
-t: prepend current time
-v: print version and exit
Some usage examples:-
$ bmi 55
bmi: 55kg 121lbs 8:9st bmi 17.7 underweight
$ bmi 75
bmi: 75kg 165lbs 11:11st bmi 24.2 normal weight
$ bmi 80
bmi: 80kg 176lbs 12:8st bmi 25.8 overweight ##........
$ bmi 85
bmi: 85kg 187lbs 13:5st bmi 27.4 overweight #####.....
$ bmi 95
bmi: 95kg 209lbs 14:13st bmi 30.6 obese
The imperial units notation "12:8st" means 12 stone 8 lbs; similarly "13:5st" means 13 stone 5 lbs. You may be wondering why bother converting to imperial units; that is because my brain still works in imperial, but my scales only provide a measurement in kg!
Within the 'overweight' bmi range, it prints a bar of '#' and '.' characters to indicate the position of the current bmi value within the range.
This is to provide a visual indication or "bar chart" of how far you will have to move in either direction to reach either the 'normal weight' or 'obese' ranges.
Using the -t option prepends the output with the current time in 24-hour format.
Using the -c option performs the weight to imperial units conversion only and then exits.
The -v option prints the program version and exits.
Currently the person's height in metres is hard-coded inside the program, in the scalar variable $height.
It would be interesting to see this re-written in both F# and Nim! (I expect my perl version can be improved too haha!

)
For bonus points add the two features I've listed under the TODO comment in the code:-
1. add a .bmirc file that contains the default height;
2. add a [-h <height in cm>] option to allow height to be specified on the command line