/**
 * This function takes a list of tuples as input, where each tuple represents an individual expense.
 * It calculates and returns the total expenses incurred by the Accountant.
 *
 * Each tuple in the list has the following format:
 * (category: String, amount: Double)
 *
 * @param expenses A list of tuples representing expenses.
 * @return The total expenses incurred.
 */
fun calculateTotalExpenses(expenses: List<Pair<String, Double>>): Double {

    var totalExpenses = 0.0

    // Iterate over each tuple in the list using a for loop
    for (expense in expenses) {
        // Unpack the tuple to get the category and amount
        val (category, amount) = expense
        totalExpenses += amount
    }

    return totalExpenses
}
/**
 * This function takes a list of tuples as input, where each tuple represents an individual expense.
 * It calculates and returns the total expenses incurred by the Accountant.
 *
 * Each tuple in the list has the following format:
 * (category: String, amount: Double)
 *
 * @param expenses A list of tuples representing expenses.
 * @return The total expenses incurred.
 */
fun calculateTotalExpenses(expenses: List<Pair<String, Double>>): Double {
/**
 * This function takes a list of tuples as input, where each tuple represents an individual expense.
 * It calculates and returns the total expenses incurred by the Accountant.
 *
 * Each tuple in the list has the following format:
 * (category: String, amount: Double)
 *
 * @param expenses A list of tuples representing expenses.
 * @return The total expenses incurred.
 */
fun calculateTotalExpenses(expenses: List<Pair<String, Double>>): Double {

    var totalExpenses = 0.0

    // Iterate over each tuple in the list using a for loop
    for (expense in expenses) {
        // Unpack the tuple to get the category and amount
        val (category, amount) = expense
        totalExpenses += amount
    }

    return totalExpenses
}