In my ongoing quest to learn ruby by doing training exercises I came across an extra credit question that basically wants me to unwrap this formula:
what = add(age, subtract(height, multiply(weight, divide(iq, 2))))
My question is I am a little stuck on this part. I understand for example that add(age, subtract would be the same as age + subtract, but after that I just become lost.
Start from the inside and work out.
Divide iq by 2. Multiply that by weight. Subtract that from height. Add that to age.
In general, with nested parentheses, you always start from the innermost.