Create exercise2

Complete the given code snippet