/**
 * Write a Kotlin program to calculate the balance of an accountant using while loop and combining it with other functions.
 *
 * The function should take two parameters:
 * - expenses: a list of expenses of an accountant
 * - income: a list of income of an accountant
 *
 * The function should iterate over the expenses list using a while loop and subtract each expense from the total balance.
 * Then, it should iterate over the income list using a for loop and add each income to the total balance.
 *
 * Finally, it should return the total balance.
 *
 * Example:
 * expenses = [100, 50, 70]
 * income = [200, 300, 150]
 * calculateTotal(expenses, income) => 530
 */
fun calculateTotal(expenses: List<Int>, income: List<Int>): Int {

    var balance = 0
    var i = 0
    while (i < expenses.size) {
        balance -= expenses[i]
        i++
    }

    for (incomeValue in income) {
        balance += incomeValue
    }

    return balance
}
/**
 * Write a Kotlin program to calculate the balance of an accountant using while loop and combining it with other functions.
 *
 * The function should take two parameters:
 * - expenses: a list of expenses of an accountant
 * - income: a list of income of an accountant
 *
 * The function should iterate over the expenses list using a while loop and subtract each expense from the total balance.
 * Then, it should iterate over the income list using a for loop and add each income to the total balance.
 *
 * Finally, it should return the total balance.
 *
 * Example:
 * expenses = [100, 50, 70]
 * income = [200, 300, 150]
 * calculateTotal(expenses, income) => 530
 */
fun calculateTotal(expenses: List<Int>, income: List<Int>): Int {
/**
 * Write a Kotlin program to calculate the balance of an accountant using while loop and combining it with other functions.
 *
 * The function should take two parameters:
 * - expenses: a list of expenses of an accountant
 * - income: a list of income of an accountant
 *
 * The function should iterate over the expenses list using a while loop and subtract each expense from the total balance.
 * Then, it should iterate over the income list using a for loop and add each income to the total balance.
 *
 * Finally, it should return the total balance.
 *
 * Example:
 * expenses = [100, 50, 70]
 * income = [200, 300, 150]
 * calculateTotal(expenses, income) => 530
 */
fun calculateTotal(expenses: List<Int>, income: List<Int>): Int {

    var balance = 0
    var i = 0
    while (i < expenses.size) {
        balance -= expenses[i]
        i++
    }

    for (incomeValue in income) {
        balance += incomeValue
    }

    return balance
}