by using fortran.90 solve the question below...
-the power (watts) and the voltage (volts) the current
(amps) drawn in a circuit can be
found from: Current= (Power)/ (Voltage).By using Select Case, write
a program that calculates the current given the power of 50 devices
(remember that the voltage is 240v in the UK) and displays the most
suitable cable for use. Consider 3 suitable cables (1.5 mm2 for up
to 5 amps, 2.5 mm2 for up to 13 amps, and 4 mm2 for up to 30 amps).
In case a suitable cable cannot be found the program should print
an appropriate message.
program findcable implicit none Real :: power, current !variable to hold power value and current Real :: cabletype ! variable to hold the result print*,"Enter the power value" !taking input from user read (*) power
current= power/240 ! calculating current
select case (current) ! applying cases on the current value case (0:5) cabletype=1.5 case (5:13) cabletype=2.5 case (13:30) cabletype=4 case default print*, "Cannot suggest the cable type." end select print*, "The cable (in mm2) to be used is:", cabletype ! printing results
end program findcable
Get Answers For Free
Most questions answered within 1 hours.