Consider the following program:
I : Integer : $=1$;
J : Integer : $=0$;
$\mathrm{K}$ : Integer : $=3$;
procedure Primary is
begin
J $:=20$;
I $:=\mathrm{K} * \mathrm{~J} / 2$
end Primary;
procedure Secondary is
begin
I : = J;
$\mathrm{K}:=4$;
end Secondary;
procedure Tertiary is
begin
J $:=20 ;$
I $:=\mathrm{K} * \mathrm{~J} / 2$
end Tertiary;
This code is to be executed in a recovery block environment and in an exceptionhandling environment. The following is the recovery block environment:
ensure $I=20$
by
Primary;
else by
Secondary;
else by
Tertiary;
else
I $:=20$;
end;
The following is the exception-handling environment:
Failed : exception;
type Module is (P,S, T);
for Try in Module loop
begin
case Try is
when $\mathrm{P} \Rightarrow$
Primary ;
if $I /=20$ then
raise Failed;
end if;
exit ;
when $S \Rightarrow$
Secondary ;
if $I /=20$ then
raise Failed;
end if;
exit;
when $\mathrm{T}=>$
Tertiary;
if $I /=20$ then
raise Failed;
end if;
exit;
end case;
exception
when Failed =>
if $\operatorname{Try}=\mathrm{T}$ then
I $:=20$;
end if;
end;
end loop;
Assuming the termination model of exception handing, compare and contrast the execution of both the recovery block environment and the exception-handling environment code fragments.