On Sep 11, 2015, at 9:00 AM, Nick Savage <
nick....@gmail.com> wrote:
>
> Any help would be appreciative and the way I learn I can not move on till I know.
>
> puts "I will now count my chickens:'"
> puts "Hens #{25 + 30 / 6}"
> #how does that equal 30?
> puts "Roosters #{100 - 25 * 3 % 4}"
> #How does this equal 97
>
> puts "Now I will count the eggs:"
>
> puts 3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6
> #How does this equal 7, is it because it is 6.5 and it rounds up.
Google "ruby operator precedence". Multiplication & division have higher precedence than addition & subtraction, is the answer to your immediate question. But you really should google and look at all the precedence categories.