• Post Reply Bookmark Topic Watch Topic
  • New Topic

reverse bmi formula  RSS feed

 
kennith stomps
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My program is to calculate the users BMI as well as tell the user what their weight should be according their goal bmi
the trouble I am having is on line 8 with the goal weight, I cannot think of what the formula should be, I have tried formulas such as


 
Campbell Ritchie
Marshal
Posts: 56525
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
bmi = weight ÷ height²
Multiply each side by height²
bmi × height² = weight
I think that is it.
Desired BMI = 23. Height = 1.7. 1.7² = 2.89. 23 × 2.89 = 66.47
 
Campbell Ritchie
Marshal
Posts: 56525
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where does 703 come from? I have never heard of other units than kg and m for BMI, so maybe 703 is a unit conversion factor.
 
Paul Clapham
Sheriff
Posts: 22819
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kennith stomps wrote:I cannot think of what the formula should be


Start by writing down the formula for BMI as a function of height and weight. It will look like "BMI = ... (something) ...", where "something" is a function of weight and height. Next, solve that equation for the weight value. Your solution will look like "weight = ... (something) ...", where "something" is a function of BMI and height. You learned how to do basic algebra like that already, right?

Finally take your solution and implement it in Java.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!