/**
 * This exercise requires the Environmental Scientist to calculate the average temperature and total precipitation
 * for a given set of data. The scientist should execute the code multiple times by looping through the data, and
 * use tuple concatenation and repeating to store the results.
 */
fun intersectionExercise(temperatureData: List<Double>, precipitationData: List<Double>): Pair<Double, Double> {

    // Initialize variables to store the sum of temperature and precipitation, and the count
    var sumTemperature = 0.0
    var sumPrecipitation = 0.0
    var count = 0

    // Loop through the temperature data and precipitation data simultaneously
    for ((temperature, precipitation) in temperatureData.zip(precipitationData)) {
        // Calculate the sum of temperature and precipitation
        sumTemperature += temperature
        sumPrecipitation += precipitation

        // Increment the count
        count++
    }

    // Calculate the average temperature and total precipitation by dividing the sum by the count
    val averageTemperature = sumTemperature / count
    val totalPrecipitation = sumPrecipitation

    // Return a pair of the average temperature and total precipitation
    return Pair(averageTemperature, totalPrecipitation)
}
/**
 * This exercise requires the Environmental Scientist to calculate the average temperature and total precipitation
 * for a given set of data. The scientist should execute the code multiple times by looping through the data, and
 * use tuple concatenation and repeating to store the results.
 */
fun intersectionExercise(temperatureData: List<Double>, precipitationData: List<Double>): Pair<Double, Double> {
/**
 * This exercise requires the Environmental Scientist to calculate the average temperature and total precipitation
 * for a given set of data. The scientist should execute the code multiple times by looping through the data, and
 * use tuple concatenation and repeating to store the results.
 */
fun intersectionExercise(temperatureData: List<Double>, precipitationData: List<Double>): Pair<Double, Double> {

    // Initialize variables to store the sum of temperature and precipitation, and the count
    var sumTemperature = 0.0
    var sumPrecipitation = 0.0
    var count = 0

    // Loop through the temperature data and precipitation data simultaneously
    for ((temperature, precipitation) in temperatureData.zip(precipitationData)) {
        // Calculate the sum of temperature and precipitation
        sumTemperature += temperature
        sumPrecipitation += precipitation

        // Increment the count
        count++
    }

    // Calculate the average temperature and total precipitation by dividing the sum by the count
    val averageTemperature = sumTemperature / count
    val totalPrecipitation = sumPrecipitation

    // Return a pair of the average temperature and total precipitation
    return Pair(averageTemperature, totalPrecipitation)
}