/**
 * Given a list of products with their prices, calculate the average price of all the products.
 *
 * @param products A list of maps representing the products. Each map has a "name" key and a "price" key.
 * @return The average price of all the products as a Float.
 */
fun calculateAveragePrice(products: List<Map<String, Any>>): Float {

    var totalPrice = 0.0
    var numProducts = 0

    for (product in products) {
        totalPrice += product["price"] as Double
        numProducts++
    }

    val averagePrice = totalPrice / numProducts

    return averagePrice.toFloat()
}
/**
 * Given a list of products with their prices, calculate the average price of all the products.
 *
 * @param products A list of maps representing the products. Each map has a "name" key and a "price" key.
 * @return The average price of all the products as a Float.
 */
fun calculateAveragePrice(products: List<Map<String, Any>>): Float {
/**
 * Given a list of products with their prices, calculate the average price of all the products.
 *
 * @param products A list of maps representing the products. Each map has a "name" key and a "price" key.
 * @return The average price of all the products as a Float.
 */
fun calculateAveragePrice(products: List<Map<String, Any>>): Float {

    var totalPrice = 0.0
    var numProducts = 0

    for (product in products) {
        totalPrice += product["price"] as Double
        numProducts++
    }

    val averagePrice = totalPrice / numProducts

    return averagePrice.toFloat()
}