/**
 * A farmer wants to calculate the amount of fertilizer required for his fields.
 * The function 'findRequirementOfFertilizers' takes in the area of the field and the index value of the field
 * and returns the requirement of the fertilizer for the given field.
 *
 * @param fieldArea The area of the field in hectares.
 * @param index The index value of the field. A negative index represents a field with negative coordinates.
 * @return The requirement of the fertilizer for the given field.
 */
fun findRequirementOfFertilizers(fieldArea: Double, index: Int): Double {

    if (fieldArea <= 0) {
        return 0.0 // Or throw an exception with an appropriate message
    }

    if (index >= 0) {
        return 0.0 // Or throw an exception with an appropriate message
    }

    return when (index) {
        -1 -> fieldArea * 0.5
        -2 -> fieldArea * 0.75
        -3 -> fieldArea
        -4 -> fieldArea * 1.25
        -5 -> TODO() // Define the calculation for index -5
        else -> 0.0 // Or throw an exception for invalid index
    }
}
/**
 * A farmer wants to calculate the amount of fertilizer required for his fields.
 * The function 'findRequirementOfFertilizers' takes in the area of the field and the index value of the field
 * and returns the requirement of the fertilizer for the given field.
 *
 * @param fieldArea The area of the field in hectares.
 * @param index The index value of the field. A negative index represents a field with negative coordinates.
 * @return The requirement of the fertilizer for the given field.
 */
fun findRequirementOfFertilizers(fieldArea: Double, index: Int): Double {
/**
 * A farmer wants to calculate the amount of fertilizer required for his fields.
 * The function 'findRequirementOfFertilizers' takes in the area of the field and the index value of the field
 * and returns the requirement of the fertilizer for the given field.
 *
 * @param fieldArea The area of the field in hectares.
 * @param index The index value of the field. A negative index represents a field with negative coordinates.
 * @return The requirement of the fertilizer for the given field.
 */
fun findRequirementOfFertilizers(fieldArea: Double, index: Int): Double {

    if (fieldArea <= 0) {
        return 0.0 // Or throw an exception with an appropriate message
    }

    if (index >= 0) {
        return 0.0 // Or throw an exception with an appropriate message
    }

    return when (index) {
        -1 -> fieldArea * 0.5
        -2 -> fieldArea * 0.75
        -3 -> fieldArea
        -4 -> fieldArea * 1.25
        -5 -> TODO() // Define the calculation for index -5
        else -> 0.0 // Or throw an exception for invalid index
    }
}