def add(a, b)
puts "ADDING #{a} + #{b}"
a + b
end
def subtract(a, b)
puts "SUBTRACTING #{a} - #{b}"
a - b
Here is my code and my question is, why do I need the extra (a + b) and (a - b) at the end? I understand that "def" is setting up the function and the 'puts "ADDING #{a} + #{b}"' is placing that code on to the screen for me to see. By why can't the system just see the way the code is placed in "puts".
I'm sorry if this is a bit confusing, but I am new to ruby. Also when I edit the a + b it won't allow me to do so. Is there a way I can edit it so that it reads the number on one line and then the other on another line. Or perhaps so that the a + b comes out as a...+...b (imagine the "." are empty spaces.)