Session Ready
Exercise

Calculating accounts receivable (debtors)

When we sell something on credit, the credit portion is in the balance sheet under ‘Accounts Receivable’ or ‘Debtors’. For example, if credit sales are made in January with a 60-day payback period, they would be recorded in our ‘Debtors’ account in January, but only be paid (released) in March, and so on.

In this exercise, we will create the following lists:

  • The credit sales in the month credits, which in this exercise is 60% of the sale value.
  • The total accounts receivable debtors, to be calculated as the credits for the current month, plus the credits of the month before, minus the credits of two months before (as we assume the credits from 2 months ago or 60 days, will be repaid by then).

We have set an index for the variable month. The month value is set at 0.

Instructions
100 XP
  • Create a blank credits list and blank debtors list.

  • Complete the for loop:

    • Calculate the credit of the month by multiplying the sales value (set to variable mvalue) by the percentage credit (60%).
    • If the month is greater than 0, append the debtors as current month credits plus credits of prior month.
    • If the month is not greater than 0, append the debtors as the current month credits.
  • Print the debtors list.