Simple homework project using the rand object