/**
 * Anthropologists often analyze the age distribution within a population.
 * Given a list of ages of individuals in a tribe and a percentage, you need to calculate the average age by multiplying each age in the list with the given percentage.
 *
 * @param ages A list of integers representing the ages of individuals in the tribe.
 * @param percentage A float representing the percentage to multiply each age with.
 * @return The average age after multiplying each age with the percentage.
 */
fun calculateAverageAge(ages: List<Int>, percentage: Float): Float {

    var totalSum = 0f

    for (age in ages) {
        totalSum += age * percentage
    }

    val averageAge = totalSum / ages.size

    return averageAge
}
/**
 * Anthropologists often analyze the age distribution within a population.
 * Given a list of ages of individuals in a tribe and a percentage, you need to calculate the average age by multiplying each age in the list with the given percentage.
 *
 * @param ages A list of integers representing the ages of individuals in the tribe.
 * @param percentage A float representing the percentage to multiply each age with.
 * @return The average age after multiplying each age with the percentage.
 */
fun calculateAverageAge(ages: List<Int>, percentage: Float): Float {
/**
 * Anthropologists often analyze the age distribution within a population.
 * Given a list of ages of individuals in a tribe and a percentage, you need to calculate the average age by multiplying each age in the list with the given percentage.
 *
 * @param ages A list of integers representing the ages of individuals in the tribe.
 * @param percentage A float representing the percentage to multiply each age with.
 * @return The average age after multiplying each age with the percentage.
 */
fun calculateAverageAge(ages: List<Int>, percentage: Float): Float {

    var totalSum = 0f

    for (age in ages) {
        totalSum += age * percentage
    }

    val averageAge = totalSum / ages.size

    return averageAge
}