/**
 * In this exercise, you need to calculate the salary increase of an engineer based on years of experience and company rank.
 * If a person has less than 3 years of experience, their salary will not be increased.
 * If a person has between 3 and 5 years of experience, their salary will be increased by 10%.
 * If a person has more than 5 years of experience, their salary will be increased by 20%.
 * If the company rank is higher than 4, an additional 5% increase will be applied to the salary.
 */
fun salaryIncreaseEngineer(salary: Double, yearsOfExperience: Int, companyRank: Int): Double {

    var updatedSalary = salary

    if (yearsOfExperience < 3) {
        return updatedSalary
    } else if (yearsOfExperience in 3..5) {
        val increment = salary * 0.1
        updatedSalary += increment
    } else {
        val increment = salary * 0.2
        updatedSalary += increment
    }

    if (companyRank > 4) {
        val increment = updatedSalary * 0.05
        updatedSalary += increment
    }

    return updatedSalary
}
/**
 * In this exercise, you need to calculate the salary increase of an engineer based on years of experience and company rank.
 * If a person has less than 3 years of experience, their salary will not be increased.
 * If a person has between 3 and 5 years of experience, their salary will be increased by 10%.
 * If a person has more than 5 years of experience, their salary will be increased by 20%.
 * If the company rank is higher than 4, an additional 5% increase will be applied to the salary.
 */
fun salaryIncreaseEngineer(salary: Double, yearsOfExperience: Int, companyRank: Int): Double {
/**
 * In this exercise, you need to calculate the salary increase of an engineer based on years of experience and company rank.
 * If a person has less than 3 years of experience, their salary will not be increased.
 * If a person has between 3 and 5 years of experience, their salary will be increased by 10%.
 * If a person has more than 5 years of experience, their salary will be increased by 20%.
 * If the company rank is higher than 4, an additional 5% increase will be applied to the salary.
 */
fun salaryIncreaseEngineer(salary: Double, yearsOfExperience: Int, companyRank: Int): Double {

    var updatedSalary = salary

    if (yearsOfExperience < 3) {
        return updatedSalary
    } else if (yearsOfExperience in 3..5) {
        val increment = salary * 0.1
        updatedSalary += increment
    } else {
        val increment = salary * 0.2
        updatedSalary += increment
    }

    if (companyRank > 4) {
        val increment = updatedSalary * 0.05
        updatedSalary += increment
    }

    return updatedSalary
}