The following programming task was set for me during a recent internship to calculate the cash flow of a claimant.