/**
 * A function that calculates the current flowing through a circuit by using the range function
 * and the break and continue statements.
 *
 * @param totalVoltage The total voltage of the circuit.
 * @param circuitResistance A list of resistance values in the circuit.
 * @return The total current flowing through the circuit.
 */
fun calculateCircuitVoltage(totalVoltage: Double, circuitResistance: List<Double>): Double {

    var totalCurrent = 0.0

    for (resistance in circuitResistance) {
        if (resistance <= 0) {
            continue
        } else {
            totalCurrent += totalVoltage / resistance
        }

        if (totalCurrent > 10) {
            break
        }
    }

    return totalCurrent
}

// Example usage
/**
 * A function that calculates the current flowing through a circuit by using the range function
 * and the break and continue statements.
 *
 * @param totalVoltage The total voltage of the circuit.
 * @param circuitResistance A list of resistance values in the circuit.
 * @return The total current flowing through the circuit.
 */
fun calculateCircuitVoltage(totalVoltage: Double, circuitResistance: List<Double>): Double {
/**
 * A function that calculates the current flowing through a circuit by using the range function
 * and the break and continue statements.
 *
 * @param totalVoltage The total voltage of the circuit.
 * @param circuitResistance A list of resistance values in the circuit.
 * @return The total current flowing through the circuit.
 */
fun calculateCircuitVoltage(totalVoltage: Double, circuitResistance: List<Double>): Double {

    var totalCurrent = 0.0

    for (resistance in circuitResistance) {
        if (resistance <= 0) {
            continue
        } else {
            totalCurrent += totalVoltage / resistance
        }

        if (totalCurrent > 10) {
            break
        }
    }

    return totalCurrent
}

// Example usage