/**
 * This function calculates the voltage using the formula: V = I * R.
 * If either the current or resistance is not a number, it returns null.
 *
 * @param current The electric current flowing through the conductor.
 * @param resistance The resistance offered by the conductor.
 * @return The voltage calculated.
 */
fun calculateVoltage(current: String, resistance: String): Double? {

    return try {
        val currentVal = current.toDouble()
        val resistanceVal = resistance.toDouble()
        currentVal * resistanceVal
    } catch (e: NumberFormatException) {
        null
    }
}
/**
 * This function calculates the voltage using the formula: V = I * R.
 * If either the current or resistance is not a number, it returns null.
 *
 * @param current The electric current flowing through the conductor.
 * @param resistance The resistance offered by the conductor.
 * @return The voltage calculated.
 */
fun calculateVoltage(current: String, resistance: String): Double? {
/**
 * This function calculates the voltage using the formula: V = I * R.
 * If either the current or resistance is not a number, it returns null.
 *
 * @param current The electric current flowing through the conductor.
 * @param resistance The resistance offered by the conductor.
 * @return The voltage calculated.
 */
fun calculateVoltage(current: String, resistance: String): Double? {

    return try {
        val currentVal = current.toDouble()
        val resistanceVal = resistance.toDouble()
        currentVal * resistanceVal
    } catch (e: NumberFormatException) {
        null
    }
}