/**
 * Given a list of daily temperatures for a given number of days,
 * this function calculates and returns the average temperature.
 *
 * @param temperatures A list of daily temperatures in Celsius.
 * @param numDays The number of days for which temperatures are available.
 * @return The average temperature.
 */
fun calculateAverageTemperature(temperatures: List<Double>, numDays: Int): Double {

    var totalTemperature = 0.0
    var dayCount = 0

    while (dayCount < numDays) {
        totalTemperature += temperatures[dayCount]
        dayCount++
    }

    val averageTemperature = totalTemperature / numDays
    return averageTemperature
}
/**
 * Given a list of daily temperatures for a given number of days,
 * this function calculates and returns the average temperature.
 *
 * @param temperatures A list of daily temperatures in Celsius.
 * @param numDays The number of days for which temperatures are available.
 * @return The average temperature.
 */
fun calculateAverageTemperature(temperatures: List<Double>, numDays: Int): Double {
/**
 * Given a list of daily temperatures for a given number of days,
 * this function calculates and returns the average temperature.
 *
 * @param temperatures A list of daily temperatures in Celsius.
 * @param numDays The number of days for which temperatures are available.
 * @return The average temperature.
 */
fun calculateAverageTemperature(temperatures: List<Double>, numDays: Int): Double {

    var totalTemperature = 0.0
    var dayCount = 0

    while (dayCount < numDays) {
        totalTemperature += temperatures[dayCount]
        dayCount++
    }

    val averageTemperature = totalTemperature / numDays
    return averageTemperature
}