Added ex4.rb
Adding ex4.rb