Java exercises from Chapter One