/**
 * Given the diameter, length, and material of a pipeline, calculate its capacity
 */
fun calculatePipelineCapacity(pipelineDiameter: Double, pipelineLength: Double, pipelineMaterial: String): Double {

    // Calculate the cross-sectional area of the pipeline
    val pipelineArea = 3.14 * (pipelineDiameter / 2) * (pipelineDiameter / 2)

    // Determine the material factor based on the pipeline material
    val materialFactor = if (pipelineMaterial == "steel") 0.7
                         else if (pipelineMaterial == "cast iron") 0.8
                         else 0.9

    // Calculate the pipeline capacity using the nested ternary operators
    val pipelineCapacity = pipelineArea * pipelineLength * 1000 * (if (pipelineMaterial == "steel") 4
                                                                  else if (pipelineMaterial == "cast iron") 3
                                                                  else 2) * materialFactor

    return pipelineCapacity
}
/**
 * Given the diameter, length, and material of a pipeline, calculate its capacity
 */
fun calculatePipelineCapacity(pipelineDiameter: Double, pipelineLength: Double, pipelineMaterial: String): Double {
/**
 * Given the diameter, length, and material of a pipeline, calculate its capacity
 */
fun calculatePipelineCapacity(pipelineDiameter: Double, pipelineLength: Double, pipelineMaterial: String): Double {

    // Calculate the cross-sectional area of the pipeline
    val pipelineArea = 3.14 * (pipelineDiameter / 2) * (pipelineDiameter / 2)

    // Determine the material factor based on the pipeline material
    val materialFactor = if (pipelineMaterial == "steel") 0.7
                         else if (pipelineMaterial == "cast iron") 0.8
                         else 0.9

    // Calculate the pipeline capacity using the nested ternary operators
    val pipelineCapacity = pipelineArea * pipelineLength * 1000 * (if (pipelineMaterial == "steel") 4
                                                                  else if (pipelineMaterial == "cast iron") 3
                                                                  else 2) * materialFactor

    return pipelineCapacity
}