(function(weight) { // how much water weighs per gallon const WATER_WEIGHT_IN_POUNDS_PER_GALLON = 8.34; // how much of the body is made of water const WATER_PERCENTAGE_IN_BODY = 0.6; function getGallonsOfWater(weight) { return weight * WATER_PERCENTAGE_IN_BODY / WATER_WEIGHT_IN_POUNDS_PER_GALLON; } function getPoundsFromGallons(gallons) { // since water is 60%, we need to figure out the other 40% // so we just find one third of 60% (20%) and then double that // to find 40% and add the two together to uncover what the original // weight was const oneThird = gallons / 3; return (gallons + (oneThird * 2)) * WATER_WEIGHT_IN_POUNDS_PER_GALLON; } console.clear(); console.log({ weight, gallons: getGallonsOfWater(weight), andBack: getPoundsFromGallons(getGallonsOfWater(weight)) }); } )(200);