This is working algorithm version 1 when Exam is of type Integer
Second version with Exam is of type Integer 1 .. 100Code:// program exits loop when Exam is valid or
// when TERMINATION_VALUE = -99 is entered
start loop
output to screen "Enter a score"
store input to Exam
exit loop when ( 0 <= Exam <= 100 ) or
when ( Exam = TERMINATION_VALUE)
output "exam score is 0 .. 100"
end loop
Second version exits loop when Exam is valid, but then how to exit when Exam = TERMINATION_VALUECode:// program exits loop when Exam is valid or
// when TERMINATION_VALUE = -99is entered
start loop
begin handler block
output to screen "Enter a score"
store input to Exam
exit
exception when CONSTRAINT_ERROR
output "exam score is 0 .. 100"
end handler block
end loop