PROGRAM Circuit_Analysis !------------------------------------------------------------------------ ! Program to determine the current in a circuit containing three ! resistors in parallel and in which a given voltage is applied. ! Variables used are: ! Voltage : voltage applied (volts) ! Resistance_1, ! Resistance_2, ! Resistance_3 : three resistances (ohms) ! TotalResistance : total resistance ! Current : current (amperes) ! ! Input: Resistance_1, Resistance_2, Resistance_3, Voltage ! Output: Current !------------------------------------------------------------------------ IMPLICIT NONE REAL :: Resistance_1, Resistance_2, Resistance_3, & TotalResistance, Voltage, Current ! Obtain three resistances and voltage PRINT *, "Enter three resistances (ohms):" READ *, Resistance_1, Resistance_2, Resistance_3 PRINT *, "Enter the voltage applied (volts):" READ *, Voltage ! Calculate total resistance and current TotalResistance = 1.0 / & (1.0 / Resistance_1 + 1.0 / Resistance_2 + 1.0 / Resistance_3) Current = Voltage / TotalResistance ! Display the current PRINT *, "The current is", Current, "amps" END PROGRAM Circuit_Analysis