Homework task 5 for the course "Programming with Ruby"