/**
 * This exercise requires the psychologist to understand the syntax of nested loops and the usage of the range function.
 * The task here is to complete the code that prints the sum of all the even numbers between the given range.
 * The code uses nested loops to iterate over the range and check if each number is even or not.
 */
fun nestedLoop(rangeStart: Int, rangeEnd: Int, increment: Int): Int {

    var totalSum = 0  // Variable to store the sum of even numbers

    for (i in rangeStart..(rangeEnd + increment) step increment) {
        if (i % 2 == 0) {  // Check if the number is even
            for (j in rangeStart..(i + increment) step increment) {
                if (j % 2 == 0) {  // Check if the number is even
                    totalSum += j
                }
            }
        }
    }

    return totalSum
}

// Code completion exercise
/**
 * This exercise requires the psychologist to understand the syntax of nested loops and the usage of the range function.
 * The task here is to complete the code that prints the sum of all the even numbers between the given range.
 * The code uses nested loops to iterate over the range and check if each number is even or not.
 */
fun nestedLoop(rangeStart: Int, rangeEnd: Int, increment: Int): Int {
/**
 * This exercise requires the psychologist to understand the syntax of nested loops and the usage of the range function.
 * The task here is to complete the code that prints the sum of all the even numbers between the given range.
 * The code uses nested loops to iterate over the range and check if each number is even or not.
 */
fun nestedLoop(rangeStart: Int, rangeEnd: Int, increment: Int): Int {

    var totalSum = 0  // Variable to store the sum of even numbers

    for (i in rangeStart..(rangeEnd + increment) step increment) {
        if (i % 2 == 0) {  // Check if the number is even
            for (j in rangeStart..(i + increment) step increment) {
                if (j % 2 == 0) {  // Check if the number is even
                    totalSum += j
                }
            }
        }
    }

    return totalSum
}

// Code completion exercise