/**
 * This function calculates the total revenue for a marketing campaign based on the number of units sold.
 *
 * @param profitPerUnit The profit made per unit sold.
 * @return The total revenue generated.
 */
fun calculateRevenue(profitPerUnit: Double): Double {

    // Define the number of units sold
    val unitsSold = listOf(10, 20, 30, 40)
  
    // Initialize a variable to store the total revenue
    var totalRevenue = 0.0

    // Nested for loop to calculate revenue for each unit sold at different prices
    for (unit in unitsSold) {
        for (price in listOf(9.99, 19.99, 29.99, 39.99)) {
            // Calculate revenue for each unit sold at a specific price
            val revenue = unit * price

            // Apply profit margin to total revenue
            totalRevenue += revenue * profitPerUnit
        }
    }
    
    return totalRevenue
}
/**
 * This function calculates the total revenue for a marketing campaign based on the number of units sold.
 *
 * @param profitPerUnit The profit made per unit sold.
 * @return The total revenue generated.
 */
fun calculateRevenue(profitPerUnit: Double): Double {
/**
 * This function calculates the total revenue for a marketing campaign based on the number of units sold.
 *
 * @param profitPerUnit The profit made per unit sold.
 * @return The total revenue generated.
 */
fun calculateRevenue(profitPerUnit: Double): Double {

    // Define the number of units sold
    val unitsSold = listOf(10, 20, 30, 40)
  
    // Initialize a variable to store the total revenue
    var totalRevenue = 0.0

    // Nested for loop to calculate revenue for each unit sold at different prices
    for (unit in unitsSold) {
        for (price in listOf(9.99, 19.99, 29.99, 39.99)) {
            // Calculate revenue for each unit sold at a specific price
            val revenue = unit * price

            // Apply profit margin to total revenue
            totalRevenue += revenue * profitPerUnit
        }
    }
    
    return totalRevenue
}