Functions
Goals
Step 1
Type this in the file area.rb:def calculate_circle_area(radius) Math::PI * (radius ** 2) end print "What is the radius of your circle? > " radius = gets.to_i puts "Your circle has an area of #{calculate_circle_area(radius)}"
Step 2
Terminalruby area.rb
Step 3
IRBdef backwards(phrase) phrase.reverse endIRBbackwards 'Hello'
Step 4
IRBmirror = backwards 'Hello'
Explanation
Next Step:
Go on to Classes