# 74. Child Support

# Description

Determines the percentage of gross income to go to child support based on the number of minor children.

# Code

// Determine the number of minor children

0

REPEAT RepeatedDialog

IF AGE( BirthDate ) < 18

RESULT + 1

END IF

END REPEAT

// Percentage of income based on number of minors

IF RESULT >= 5

34

ELSE IF RESULT = 4

31

ELSE IF RESULT = 3

29

ELSE IF RESULT = 2

25

ELSE

17

END IF

# Explanation

This computation returns a number that represents the percentage of gross income that should be paid as child support. The percentage is based upon the number of minor children. Note that it does not return the amount of income to be paid, but rather a percentage that can be applied to the gross income to obtain the payment amount.

The computation assumes a repeated dialog called "RepeatedDialog" in the script. This is the dialog that collects information about the children. You will likely name it differently. The dialog contains a date variable called "BirthDate" which collects the birth dates for the children.

The script first determines how many of the children are minors by iterating through the dialog and counting each child under 18 years of age. The script then returns a percentage figure based on the number of minor children. For example, if there are 5 or more minors, the script returns 34 for 34% of gross income. You can alter the percentages to fit your purposes.