Solution to Programming Assignment 1 (Activity monitoring data)