Sep-24-2017, 09:10 AM
The following subroutine returns a value to the main program
SUBROUTINE checkval (value, low, high)
IF value < low THEN
RETURN “Low”
ELSE IF value > high
RETURN “High”
ELSE
RETURN “OK”
ENDIF
ENDSUBROUTINE
In the main program, the following statements are written.
OUTPUT (“Please enter measurement:”)
measurement USERINPUT
Write one or more statements which will call the subroutine in order to check whether the measurement is between 18 and 25, and output the result.
This is a question on my homework, but I haven't been taught how to do this by my teacher, so I'm clueless. Could someone explain how to do this? Thanks.
SUBROUTINE checkval (value, low, high)
IF value < low THEN
RETURN “Low”
ELSE IF value > high
RETURN “High”
ELSE
RETURN “OK”
ENDIF
ENDSUBROUTINE
In the main program, the following statements are written.
OUTPUT (“Please enter measurement:”)
measurement USERINPUT
Write one or more statements which will call the subroutine in order to check whether the measurement is between 18 and 25, and output the result.
This is a question on my homework, but I haven't been taught how to do this by my teacher, so I'm clueless. Could someone explain how to do this? Thanks.