/**
 * This function calculates the population growth for a given year using the given growth rate and initial population.
 */
fun calculatePopulationGrowth(year: Int, initialPopulation: Double, growthRate: Double): Double {

    var population = initialPopulation

    var currentYear = year
    while (currentYear <= 2021) {
        population += population * growthRate
        currentYear++
    }

    return population
}
/**
 * This function calculates the population growth for a given year using the given growth rate and initial population.
 */
fun calculatePopulationGrowth(year: Int, initialPopulation: Double, growthRate: Double): Double {
/**
 * This function calculates the population growth for a given year using the given growth rate and initial population.
 */
fun calculatePopulationGrowth(year: Int, initialPopulation: Double, growthRate: Double): Double {

    var population = initialPopulation

    var currentYear = year
    while (currentYear <= 2021) {
        population += population * growthRate
        currentYear++
    }

    return population
}