solution to Interactive program Exercise