/**
 * A civil engineer needs to calculate the required pump capacity for a specific project. The pump efficiency,
 * pump head, and flow rate are given. The code should determine the pump capacity by using the provided formula.
 *
 * The formula to calculate pump capacity is:
 * Pump Capacity = (Flow Rate x Pump Head) / Pump Efficiency
 *
 * @param pumpEfficiency The efficiency of the pump, expressed as a decimal value.
 * @param pumpHead The head of the pump, measured in meters.
 * @param flowRate The flow rate of the pump, measured in cubic meters per second.
 * @return The required pump capacity, rounded to 2 decimal places.
 */
fun calculatePumpCapacity(pumpEfficiency: Double, pumpHead: Double, flowRate: Double): Double {

    val pumpCapacity = (flowRate * pumpHead) / pumpEfficiency
    return pumpCapacity.round(2)
}

fun Double.round(decimals: Int): Double = "%.${decimals}f".format(this).toDouble()
/**
 * A civil engineer needs to calculate the required pump capacity for a specific project. The pump efficiency,
 * pump head, and flow rate are given. The code should determine the pump capacity by using the provided formula.
 *
 * The formula to calculate pump capacity is:
 * Pump Capacity = (Flow Rate x Pump Head) / Pump Efficiency
 *
 * @param pumpEfficiency The efficiency of the pump, expressed as a decimal value.
 * @param pumpHead The head of the pump, measured in meters.
 * @param flowRate The flow rate of the pump, measured in cubic meters per second.
 * @return The required pump capacity, rounded to 2 decimal places.
 */
fun calculatePumpCapacity(pumpEfficiency: Double, pumpHead: Double, flowRate: Double): Double {
/**
 * A civil engineer needs to calculate the required pump capacity for a specific project. The pump efficiency,
 * pump head, and flow rate are given. The code should determine the pump capacity by using the provided formula.
 *
 * The formula to calculate pump capacity is:
 * Pump Capacity = (Flow Rate x Pump Head) / Pump Efficiency
 *
 * @param pumpEfficiency The efficiency of the pump, expressed as a decimal value.
 * @param pumpHead The head of the pump, measured in meters.
 * @param flowRate The flow rate of the pump, measured in cubic meters per second.
 * @return The required pump capacity, rounded to 2 decimal places.
 */
fun calculatePumpCapacity(pumpEfficiency: Double, pumpHead: Double, flowRate: Double): Double {

    val pumpCapacity = (flowRate * pumpHead) / pumpEfficiency
    return pumpCapacity.round(2)
}

fun Double.round(decimals: Int): Double = "%.${decimals}f".format(this).toDouble()