/**
 * This function calculates the change in slope of a geological formation based on the amount of rainfall.
 *
 * @param intercept The initial intercept value of the formation.
 * @param slope The initial slope of the formation.
 * @param rain The amount of rainfall in inches.
 * @return The new slope of the formation after considering the rainfall.
 */
fun calculateSlope(intercept: Double, slope: Double, rain: Double): Double {

    // Complete the code to calculate the new slope based on the rainfall using addition assignment operators and nested logical operators

    // If the amount of rainfall is less than 1 inch, the slope remains unchanged
    val newSlope: Double = if (rain < 1) {
        slope
    } else if (rain in 1.0..5.0) { // If the amount of rainfall is between 1 and 5 inches (both inclusive), decrease the initial slope by 10%
        slope - (slope * 0.1)
    } else { // If the amount of rainfall is greater than 5 inches, decrease the initial slope by 20%
        slope - (slope * 0.2)
    }

    return newSlope
}
/**
 * This function calculates the change in slope of a geological formation based on the amount of rainfall.
 *
 * @param intercept The initial intercept value of the formation.
 * @param slope The initial slope of the formation.
 * @param rain The amount of rainfall in inches.
 * @return The new slope of the formation after considering the rainfall.
 */
fun calculateSlope(intercept: Double, slope: Double, rain: Double): Double {
/**
 * This function calculates the change in slope of a geological formation based on the amount of rainfall.
 *
 * @param intercept The initial intercept value of the formation.
 * @param slope The initial slope of the formation.
 * @param rain The amount of rainfall in inches.
 * @return The new slope of the formation after considering the rainfall.
 */
fun calculateSlope(intercept: Double, slope: Double, rain: Double): Double {

    // Complete the code to calculate the new slope based on the rainfall using addition assignment operators and nested logical operators

    // If the amount of rainfall is less than 1 inch, the slope remains unchanged
    val newSlope: Double = if (rain < 1) {
        slope
    } else if (rain in 1.0..5.0) { // If the amount of rainfall is between 1 and 5 inches (both inclusive), decrease the initial slope by 10%
        slope - (slope * 0.1)
    } else { // If the amount of rainfall is greater than 5 inches, decrease the initial slope by 20%
        slope - (slope * 0.2)
    }

    return newSlope
}