exercise 2 output with array foreach loop