/**
 * Calculate the compound interest on a given principal amount over a specific number of years.
 *
 * @param principal The initial amount of money invested.
 * @param rate The annual interest rate.
 * @param years The number of years the principal will be invested.
 * @return The total amount of money after the interest has been compounded.
 */
fun calculateInterest(principal: Double, rate: Double, years: Int): Double {

    var compoundInterest = principal

    repeat(years) {
        compoundInterest += compoundInterest * rate
    }

    return compoundInterest
}
/**
 * Calculate the compound interest on a given principal amount over a specific number of years.
 *
 * @param principal The initial amount of money invested.
 * @param rate The annual interest rate.
 * @param years The number of years the principal will be invested.
 * @return The total amount of money after the interest has been compounded.
 */
fun calculateInterest(principal: Double, rate: Double, years: Int): Double {
/**
 * Calculate the compound interest on a given principal amount over a specific number of years.
 *
 * @param principal The initial amount of money invested.
 * @param rate The annual interest rate.
 * @param years The number of years the principal will be invested.
 * @return The total amount of money after the interest has been compounded.
 */
fun calculateInterest(principal: Double, rate: Double, years: Int): Double {

    var compoundInterest = principal

    repeat(years) {
        compoundInterest += compoundInterest * rate
    }

    return compoundInterest
}