Program submitted as Assignment 3 for BIF724 at Seneca@York