/**
 * This exercise aims to test the understanding of the subtraction assignment operator and loops for firefighters.
 * Given the firefighter's monthly salary and the number of months, the task is to calculate the remaining balance
 * after deducting the monthly expenses from the salary using the subtraction assignment operator.
 * The code should be written using loops instead of direct calculations.
 */
fun subtractionAssignmentOperatorLoop(firefighterSalary: Double, months: Int): Double {

    var remainingBalance = firefighterSalary  // Initialize the remaining balance variable with the firefighter's salary

    repeat(months) { _ ->  // Loop from 0 to (months - 1)
        // User should fill in the missing code to calculate the expenses for each month using the subtraction assignment operator
        val monthlyExpenses = 0.0  // Fill in the missing code for monthly expenses

        remainingBalance -= monthlyExpenses  // Subtract monthly expenses from the remaining balance using the subtraction assignment operator
    }

    return remainingBalance
}
/**
 * This exercise aims to test the understanding of the subtraction assignment operator and loops for firefighters.
 * Given the firefighter's monthly salary and the number of months, the task is to calculate the remaining balance
 * after deducting the monthly expenses from the salary using the subtraction assignment operator.
 * The code should be written using loops instead of direct calculations.
 */
fun subtractionAssignmentOperatorLoop(firefighterSalary: Double, months: Int): Double {
/**
 * This exercise aims to test the understanding of the subtraction assignment operator and loops for firefighters.
 * Given the firefighter's monthly salary and the number of months, the task is to calculate the remaining balance
 * after deducting the monthly expenses from the salary using the subtraction assignment operator.
 * The code should be written using loops instead of direct calculations.
 */
fun subtractionAssignmentOperatorLoop(firefighterSalary: Double, months: Int): Double {

    var remainingBalance = firefighterSalary  // Initialize the remaining balance variable with the firefighter's salary

    repeat(months) { _ ->  // Loop from 0 to (months - 1)
        // User should fill in the missing code to calculate the expenses for each month using the subtraction assignment operator
        val monthlyExpenses = 0.0  // Fill in the missing code for monthly expenses

        remainingBalance -= monthlyExpenses  // Subtract monthly expenses from the remaining balance using the subtraction assignment operator
    }

    return remainingBalance
}