/**
 * This function calculates the power using the formula: P = V * I.
 * If either the voltage or current is not a number, it returns null.
 *
 * @param voltage The potential difference across the circuit.
 * @param current The electric current flowing through the conductor.
 * @return The power calculated.
 */
fun calculatePower(voltage: String, current: String): Double? {

    return try {
        val voltageValue = voltage.toDouble()
        val currentValue = current.toDouble()
        voltageValue * currentValue
    } catch (e: NumberFormatException) {
        null
    }
}
/**
 * This function calculates the power using the formula: P = V * I.
 * If either the voltage or current is not a number, it returns null.
 *
 * @param voltage The potential difference across the circuit.
 * @param current The electric current flowing through the conductor.
 * @return The power calculated.
 */
fun calculatePower(voltage: String, current: String): Double? {
/**
 * This function calculates the power using the formula: P = V * I.
 * If either the voltage or current is not a number, it returns null.
 *
 * @param voltage The potential difference across the circuit.
 * @param current The electric current flowing through the conductor.
 * @return The power calculated.
 */
fun calculatePower(voltage: String, current: String): Double? {

    return try {
        val voltageValue = voltage.toDouble()
        val currentValue = current.toDouble()
        voltageValue * currentValue
    } catch (e: NumberFormatException) {
        null
    }
}