Python Forum

Full Version: "Call the subroutine in order to check..."
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
That doesn't look like python at all.
If I had to guess, I'd say it's VB.