/* junior108.d 2008, problem 1, junior problems Body Mass Index Calculate if a patient if overweight, normal, or underweight August 9th, 2008 */ //Imports import std.stdio; /***** *Main* *****/ void main() { writef( "Enter weight: " ); double weight; scanf( "%f", &weight ); writef( "Enter height: " ); double height; scanf( "%f", &height ); double bodyMassIndex = weight / ( height * height ); if ( bodyMassIndex < 18.5 ) { writefln( "Underweight" ); } else if ( bodyMassIndex >= 18.5 || bodyMassIndex <= 25.0 ) { writefln( "Normal weight" ); } else { writefln( "Overweight" ); } writef( bodyMassIndex ); }