/**
 * Given the starting budget, projected revenue, and a list of actual expenses incurred,
 * calculate the remaining budget by subtracting the expenses from the starting budget
 * and adding the revenue to the result.
 *
 * @param startingBudget The initial budget allocated for marketing activities.
 * @param projectedRevenue The expected revenue generated from marketing efforts.
 * @param actualExpensesList A list of actual expenses incurred for marketing activities.
 * @return The remaining budget after deducting the expenses and adding revenue.
 */
fun calculateBudget(startingBudget: Double, projectedRevenue: Double, actualExpensesList: List<Double>): Double {

    var remainingBudget = startingBudget

    for (expense in actualExpensesList) {
        if (expense > remainingBudget) {
            println("!!WARNING!!: Expense exceeds the remaining budget. Consider reallocating funds.")
            break
        }
        remainingBudget -= expense
    }

    remainingBudget += projectedRevenue

    return remainingBudget
}
/**
 * Given the starting budget, projected revenue, and a list of actual expenses incurred,
 * calculate the remaining budget by subtracting the expenses from the starting budget
 * and adding the revenue to the result.
 *
 * @param startingBudget The initial budget allocated for marketing activities.
 * @param projectedRevenue The expected revenue generated from marketing efforts.
 * @param actualExpensesList A list of actual expenses incurred for marketing activities.
 * @return The remaining budget after deducting the expenses and adding revenue.
 */
fun calculateBudget(startingBudget: Double, projectedRevenue: Double, actualExpensesList: List<Double>): Double {
/**
 * Given the starting budget, projected revenue, and a list of actual expenses incurred,
 * calculate the remaining budget by subtracting the expenses from the starting budget
 * and adding the revenue to the result.
 *
 * @param startingBudget The initial budget allocated for marketing activities.
 * @param projectedRevenue The expected revenue generated from marketing efforts.
 * @param actualExpensesList A list of actual expenses incurred for marketing activities.
 * @return The remaining budget after deducting the expenses and adding revenue.
 */
fun calculateBudget(startingBudget: Double, projectedRevenue: Double, actualExpensesList: List<Double>): Double {

    var remainingBudget = startingBudget

    for (expense in actualExpensesList) {
        if (expense > remainingBudget) {
            println("!!WARNING!!: Expense exceeds the remaining budget. Consider reallocating funds.")
            break
        }
        remainingBudget -= expense
    }

    remainingBudget += projectedRevenue

    return remainingBudget
}