Q4 of assignment 1 for IT6253 Programming 2