Second programming assignment of the R Programming Course