write a ruby program to solve exercise 1.2-3