/**
 * This function calculates the area of a rectangle based on the given height and width.
 * The parameter 'condition' determines the type of shape and operation to be performed.
 */
fun calculateArea(height: Double, width: Double, condition: String): Double {

    var area: Double = 0.0

    // Determine the shape and perform operations accordingly
    when (condition) {
        "rectangle" -> area = height * width
        "square" -> area = height * height
        "triangle" -> area = (height * width) / 2
        else -> println("Invalid condition.")
    }

    return area
}
/**
 * This function calculates the area of a rectangle based on the given height and width.
 * The parameter 'condition' determines the type of shape and operation to be performed.
 */
fun calculateArea(height: Double, width: Double, condition: String): Double {
/**
 * This function calculates the area of a rectangle based on the given height and width.
 * The parameter 'condition' determines the type of shape and operation to be performed.
 */
fun calculateArea(height: Double, width: Double, condition: String): Double {

    var area: Double = 0.0

    // Determine the shape and perform operations accordingly
    when (condition) {
        "rectangle" -> area = height * width
        "square" -> area = height * height
        "triangle" -> area = (height * width) / 2
        else -> println("Invalid condition.")
    }

    return area
}