This is Assignment 11.1.3 from NCVPS Computer Programming I