Code to answer section 1.1 exercises 6 and 7