Fruit exercise with foreach loop