
properties = ['oo', 'duck-typed', 'productive', 'fun']
properties.each {|prop| puts "Ruby is #{prop}."}
x = 4
y = 3
puts "Ruby is No #{x-y}."

puts "Outputting the squares of the first four natural numbers using the map function:"

def square(x)
    return x*x
end

puts (1..4).map{|x| square(x)}

puts "Outputting the area of a 10x5 rectangle using a class:"

class Rectangle
    
    def initialize(width, height)
        @width = width
        @height = height
    end
    
    def area()
        return @width * @height
    end
end

rectangle1 = Rectangle.new(10,5)
puts rectangle1.area()