/**
 * This exercise is intended for Aerospace Engineers to practice working with floating-point numbers and using the when statement.
 *
 * Given three floating-point numbers x, y, and z, write a function that performs the following operations on them:
 * 1. If x is greater than y and z, return the average of x and y.
 * 2. If y is greater than x and z, return the result of multiplying x and y.
 * 3. If z is greater than x and y, return the square root of z.
 * 4. Otherwise, return the sum of x, y, and z.
 *
 * Your task is to complete the code by adding the necessary when statement.
 *
 * @param x First floating-point number.
 * @param y Second floating-point number.
 * @param z Third floating-point number.
 * @return The result of the specified operations based on the given conditions.
 */
fun floatingPointOperations(x: Double, y: Double, z: Double): Double {

    return when {
        x > y && x > z -> (x + y) / 2
        y > x && y > z -> x * y
        z > x && z > y -> Math.sqrt(z)
        else -> x + y + z
    }
}
/**
 * This exercise is intended for Aerospace Engineers to practice working with floating-point numbers and using the when statement.
 *
 * Given three floating-point numbers x, y, and z, write a function that performs the following operations on them:
 * 1. If x is greater than y and z, return the average of x and y.
 * 2. If y is greater than x and z, return the result of multiplying x and y.
 * 3. If z is greater than x and y, return the square root of z.
 * 4. Otherwise, return the sum of x, y, and z.
 *
 * Your task is to complete the code by adding the necessary when statement.
 *
 * @param x First floating-point number.
 * @param y Second floating-point number.
 * @param z Third floating-point number.
 * @return The result of the specified operations based on the given conditions.
 */
fun floatingPointOperations(x: Double, y: Double, z: Double): Double {
/**
 * This exercise is intended for Aerospace Engineers to practice working with floating-point numbers and using the when statement.
 *
 * Given three floating-point numbers x, y, and z, write a function that performs the following operations on them:
 * 1. If x is greater than y and z, return the average of x and y.
 * 2. If y is greater than x and z, return the result of multiplying x and y.
 * 3. If z is greater than x and y, return the square root of z.
 * 4. Otherwise, return the sum of x, y, and z.
 *
 * Your task is to complete the code by adding the necessary when statement.
 *
 * @param x First floating-point number.
 * @param y Second floating-point number.
 * @param z Third floating-point number.
 * @return The result of the specified operations based on the given conditions.
 */
fun floatingPointOperations(x: Double, y: Double, z: Double): Double {

    return when {
        x > y && x > z -> (x + y) / 2
        y > x && y > z -> x * y
        z > x && z > y -> Math.sqrt(z)
        else -> x + y + z
    }
}