/**
 * This function calculates the final price of a product after a certain number of years of inflation.
 *
 * @param initialPrice The initial price of the product.
 * @param inflationRate The rate of inflation per year (expressed as a decimal).
 * @param numYears The number of years of inflation.
 * @return The final price of the product after the specified number of years.
 *
 * Example:
 * calculatePriceInflation(100.0, 0.05, 3) -> 115.7625
 * calculatePriceInflation(500.0, 0.1, 5) -> 805.255025
 */
fun calculatePriceInflation(initialPrice: Double, inflationRate: Double, numYears: Int): Double {

    var finalPrice = initialPrice
    var year = 1

    while (year <= numYears) {
        finalPrice *= (1 + inflationRate)
        year++
    }

    return finalPrice
}
/**
 * This function calculates the final price of a product after a certain number of years of inflation.
 *
 * @param initialPrice The initial price of the product.
 * @param inflationRate The rate of inflation per year (expressed as a decimal).
 * @param numYears The number of years of inflation.
 * @return The final price of the product after the specified number of years.
 *
 * Example:
 * calculatePriceInflation(100.0, 0.05, 3) -> 115.7625
 * calculatePriceInflation(500.0, 0.1, 5) -> 805.255025
 */
fun calculatePriceInflation(initialPrice: Double, inflationRate: Double, numYears: Int): Double {
/**
 * This function calculates the final price of a product after a certain number of years of inflation.
 *
 * @param initialPrice The initial price of the product.
 * @param inflationRate The rate of inflation per year (expressed as a decimal).
 * @param numYears The number of years of inflation.
 * @return The final price of the product after the specified number of years.
 *
 * Example:
 * calculatePriceInflation(100.0, 0.05, 3) -> 115.7625
 * calculatePriceInflation(500.0, 0.1, 5) -> 805.255025
 */
fun calculatePriceInflation(initialPrice: Double, inflationRate: Double, numYears: Int): Double {

    var finalPrice = initialPrice
    var year = 1

    while (year <= numYears) {
        finalPrice *= (1 + inflationRate)
        year++
    }

    return finalPrice
}