Hello all,
I have to write a program that calculate a bmi of person whose weight is 170 pounds (it increases by 1 pound for each month for 12 months) and 70 inches, after I have all the bmi for each weight from 170 - 182 pounds, under each weight I need to indicate if his bmi is underweight, normal, overweight or obese. I have written the program using php script, but it does not seem to work correctly, could anyone shed some light on this. The program code is:
<html>
<head>
<title>Lab 10a</title>
</head>
<body>
<?php
$pounds = 170;
$inches = 70;
$increase = 0;
$poundsinch = 703;
while ($increase < 13)
{
$division = ($pounds) / ($inches * $inches) * ($poundsinch);
echo "The BMI of $pounds pounds and $inches inches is : ".$division."<br />";
echo " ";
$increase = $increase + 1;
$pounds = $pounds + 1;
if ($division < 18.5)
echo "You are underweight";
elseif ($division < 25){
echo "Your BMI is normal";
elseif ($division < 29.9)
echo "You are overweight";
else{
echo "You are obese";
}
?>
</body>
</html>
Thanks in advance,
Tony