/**
 * This exercise focuses on the intersection of "Branching Statements" and "nested if-else statements".
 * The objective is to identify the type of rock based on its name, hardness, and color.
 * The function takes three parameters: rockName (String), rockHardness (Float), and rockColor (String).
 * The function returns a String which represents the identified rock type.
 */
fun rockIdentification(rockName: String, rockHardness: Float, rockColor: String): String {

    // Check if the rock is not classified
    if (rockName == "Unknown") {
        if (rockHardness >= 8.0) {
            when (rockColor) {
                "Black" -> return "Obsidian"
                "Grey" -> return "Basalt"
                else -> return "Unknown Rock"
            }
        } else {
            return "Unknown Rock"
        }
    }

    // Check if the rock is sedimentary
    else if (rockName == "Sedimentary") {
        if (rockHardness < 4.0) {
            when (rockColor) {
                "Brown" -> return "Limestone"
                "White" -> return "Chalk"
                else -> return "Unknown Rock"
            }
        } else if (rockHardness >= 4.0) {
            // Add more conditions for sedimentary rocks with different hardness levels and colors
        }
    }

    return "Unknown Rock"
}
/**
 * This exercise focuses on the intersection of "Branching Statements" and "nested if-else statements".
 * The objective is to identify the type of rock based on its name, hardness, and color.
 * The function takes three parameters: rockName (String), rockHardness (Float), and rockColor (String).
 * The function returns a String which represents the identified rock type.
 */
fun rockIdentification(rockName: String, rockHardness: Float, rockColor: String): String {
/**
 * This exercise focuses on the intersection of "Branching Statements" and "nested if-else statements".
 * The objective is to identify the type of rock based on its name, hardness, and color.
 * The function takes three parameters: rockName (String), rockHardness (Float), and rockColor (String).
 * The function returns a String which represents the identified rock type.
 */
fun rockIdentification(rockName: String, rockHardness: Float, rockColor: String): String {

    // Check if the rock is not classified
    if (rockName == "Unknown") {
        if (rockHardness >= 8.0) {
            when (rockColor) {
                "Black" -> return "Obsidian"
                "Grey" -> return "Basalt"
                else -> return "Unknown Rock"
            }
        } else {
            return "Unknown Rock"
        }
    }

    // Check if the rock is sedimentary
    else if (rockName == "Sedimentary") {
        if (rockHardness < 4.0) {
            when (rockColor) {
                "Brown" -> return "Limestone"
                "White" -> return "Chalk"
                else -> return "Unknown Rock"
            }
        } else if (rockHardness >= 4.0) {
            // Add more conditions for sedimentary rocks with different hardness levels and colors
        }
    }

    return "Unknown Rock"
}