Functions
Goals
- Create a function
- Call a function
Step 1
Type this in the file area.rb:def 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 #{circle_area(radius)}"Type this in the terminal:ruby area.rb
Explanation
Next Step:
Go on to Objects