/**
 * This function calculates the soil moisture level based on temperature and precipitation.
 * It uses conditional statements and iterates over a specific range to determine the soil moisture level.
 * The soil moisture levels are categorized as follows:
 * - Arid: If precipitation is less than 100mm and temperature is above 30 degrees Celsius
 * - Semi-Arid: If precipitation is between 100mm and 500mm, inclusive, and temperature is above 20 degrees Celsius
 * - Moist: If precipitation is between 500mm and 1000mm, inclusive, and temperature is above 10 degrees Celsius
 * - Wet: If precipitation is greater than 1000mm and temperature is above 5 degrees Celsius
 * - Unknown: If none of the above conditions are met
 *
 * @param temperature Temperature in degrees Celsius
 * @param precipitation Precipitation in millimeters
 * @return Soil moisture level category
 */
fun calculateSoilMoisture(temperature: Double, precipitation: Double): String {

    return when {
        precipitation < 100 && temperature > 30 -> "Arid"
        precipitation in 100.0..500.0 && temperature > 20 -> "Semi-Arid"
        else -> "Unknown"
    }
}
/**
 * This function calculates the soil moisture level based on temperature and precipitation.
 * It uses conditional statements and iterates over a specific range to determine the soil moisture level.
 * The soil moisture levels are categorized as follows:
 * - Arid: If precipitation is less than 100mm and temperature is above 30 degrees Celsius
 * - Semi-Arid: If precipitation is between 100mm and 500mm, inclusive, and temperature is above 20 degrees Celsius
 * - Moist: If precipitation is between 500mm and 1000mm, inclusive, and temperature is above 10 degrees Celsius
 * - Wet: If precipitation is greater than 1000mm and temperature is above 5 degrees Celsius
 * - Unknown: If none of the above conditions are met
 *
 * @param temperature Temperature in degrees Celsius
 * @param precipitation Precipitation in millimeters
 * @return Soil moisture level category
 */
fun calculateSoilMoisture(temperature: Double, precipitation: Double): String {
/**
 * This function calculates the soil moisture level based on temperature and precipitation.
 * It uses conditional statements and iterates over a specific range to determine the soil moisture level.
 * The soil moisture levels are categorized as follows:
 * - Arid: If precipitation is less than 100mm and temperature is above 30 degrees Celsius
 * - Semi-Arid: If precipitation is between 100mm and 500mm, inclusive, and temperature is above 20 degrees Celsius
 * - Moist: If precipitation is between 500mm and 1000mm, inclusive, and temperature is above 10 degrees Celsius
 * - Wet: If precipitation is greater than 1000mm and temperature is above 5 degrees Celsius
 * - Unknown: If none of the above conditions are met
 *
 * @param temperature Temperature in degrees Celsius
 * @param precipitation Precipitation in millimeters
 * @return Soil moisture level category
 */
fun calculateSoilMoisture(temperature: Double, precipitation: Double): String {

    return when {
        precipitation < 100 && temperature > 30 -> "Arid"
        precipitation in 100.0..500.0 && temperature > 20 -> "Semi-Arid"
        else -> "Unknown"
    }
}