[SOLVED] Need a little help with my equation....
Posted: Sat Mar 28, 2009 2:49 pm
need to get the rmr
Im getting the wrong answer when I run the program.
If I input the numbers found in thie image, http://tinyrealm.com/~efa/cisc2305/pics/rmr.jpg
I get a different answer on my program than the other program in the image.
********************************
* RMR = (9.99w + 6.25s) - 4.92a + 166g
* w = weight in kilograms; if you know your weight in pounds,
divide by 2.2 to get your weight in kilograms
* s = height in centimeters; if you know your height in inches,
multiply by 2.54 to get your height in centimeters
* a = age in years
* g = gender = 1 for males, 0 for females
********************************
//my equation so far
((((9.99 * wk) + (6.25 * hc)) - (4.92 * ageyears) + gender)) //wk is weight in kilograms aka w
//hc is height in centimeters aka s
//height in Centimeters so far
hc = (float)(((heightfeet * 12) * 2.54) + (heightinch * 2.54));
//weight in Kilograms so far
wk = (float)((weightpounds) / (2.2));
source code for visual c#
Im getting the wrong answer when I run the program.
If I input the numbers found in thie image, http://tinyrealm.com/~efa/cisc2305/pics/rmr.jpg
I get a different answer on my program than the other program in the image.
********************************
* RMR = (9.99w + 6.25s) - 4.92a + 166g
* w = weight in kilograms; if you know your weight in pounds,
divide by 2.2 to get your weight in kilograms
* s = height in centimeters; if you know your height in inches,
multiply by 2.54 to get your height in centimeters
* a = age in years
* g = gender = 1 for males, 0 for females
********************************
//my equation so far
((((9.99 * wk) + (6.25 * hc)) - (4.92 * ageyears) + gender)) //wk is weight in kilograms aka w
//hc is height in centimeters aka s
//height in Centimeters so far
hc = (float)(((heightfeet * 12) * 2.54) + (heightinch * 2.54));
//weight in Kilograms so far
wk = (float)((weightpounds) / (2.2));
source code for visual c#