philoserf (philoserf) wrote,
philoserf
philoserf

Show-IdealWeight.ps1

# Body Mass Index and Ideal Weight Calculator
 
param (
  [float]$weight = (read-host -prompt "Enter weight in pounds"),
  [float]$height = (read-host -prompt "Enter height in inches")
)
 
$idealBmi = ((18.5 + 24.9) / 2) # midpoint of normal range 
$currentBmi = ($weight / ($height * $height)) * 703
$idealWeight = (($idealBmi / 703) * ($height * $height))
 
$bmiPrime = $currentBmi / 25
 
"`nBody Mass Index and Ideal Weight Calculator
 
Body Mass Index
`tCurrent BMI: $currentBmi
`tBMI Prime Ratio: $bmiPrime
`tIdeal BMI: $idealBmi
`tDifference: $($currentBmi - $idealBmi)
 
Weight
`tCurrent Weight: $weight
`tIdeal Weight: $idealWeight
`tDifference: $($weight - $idealWeight)`n"
 

Subscribe

  • Moved

    I have moved to WordPress at http://philoserf.com/

  • Selection Problem

    I'm finally reading Leo Babauta's The Power of Less. I have read, or have on the list to read, many productivity books. It is a fascination of…

  • Down

    Over tired and lost, not accomplishing what I want, not accomplishing what I need. Difficulty thinking, planning, organizing. Over-extended, in work,…

  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments