/**
 * Given the information of a person, this function performs checks and returns the family status.
 *
 * @param personName Name of the person.
 * @param spouseName Name of the spouse.
 * @param isMarried Indicates if the person is currently married.
 * @param childrenNames Names of the children as a list.
 * @param isDivorced Indicates if the person is divorced.
 * @param hasChildren Indicates if the person has any children.
 * @return Family status based on the input information ('Single', 'Married with children', 'Married without children', 'Divorced with children', 'Divorced without children').
 */
fun checkFamilyStatus(personName: String, spouseName: String, isMarried: Boolean, childrenNames: List<String>, isDivorced: Boolean, hasChildren: Boolean): String {

    return when {
        isMarried && hasChildren -> "Married with children"
        isMarried && !hasChildren -> "Married without children"
        isDivorced && hasChildren -> "Divorced with children"
        isDivorced && !hasChildren -> "Divorced without children"
        else -> "Single"
    }
}
/**
 * Given the information of a person, this function performs checks and returns the family status.
 *
 * @param personName Name of the person.
 * @param spouseName Name of the spouse.
 * @param isMarried Indicates if the person is currently married.
 * @param childrenNames Names of the children as a list.
 * @param isDivorced Indicates if the person is divorced.
 * @param hasChildren Indicates if the person has any children.
 * @return Family status based on the input information ('Single', 'Married with children', 'Married without children', 'Divorced with children', 'Divorced without children').
 */
fun checkFamilyStatus(personName: String, spouseName: String, isMarried: Boolean, childrenNames: List<String>, isDivorced: Boolean, hasChildren: Boolean): String {
/**
 * Given the information of a person, this function performs checks and returns the family status.
 *
 * @param personName Name of the person.
 * @param spouseName Name of the spouse.
 * @param isMarried Indicates if the person is currently married.
 * @param childrenNames Names of the children as a list.
 * @param isDivorced Indicates if the person is divorced.
 * @param hasChildren Indicates if the person has any children.
 * @return Family status based on the input information ('Single', 'Married with children', 'Married without children', 'Divorced with children', 'Divorced without children').
 */
fun checkFamilyStatus(personName: String, spouseName: String, isMarried: Boolean, childrenNames: List<String>, isDivorced: Boolean, hasChildren: Boolean): String {

    return when {
        isMarried && hasChildren -> "Married with children"
        isMarried && !hasChildren -> "Married without children"
        isDivorced && hasChildren -> "Divorced with children"
        isDivorced && !hasChildren -> "Divorced without children"
        else -> "Single"
    }
}