program toy;
var
Option : Integer;
procedure ShowMenu;
begin
writeln;
writeln( '+------------------+' );
writeln( '| MENU |' );
writeln( '+------------------+' );
writeln( '| Options: |' );
writeln( '| 0=sleeps |' );
writeln( '| 1=laughs |' );
writeln( '| 2=cries |' );
writeln( '| 3=sings |' );
writeln( '| 4=exit |' );
writeln( '+------------------+' );
writeln;
end;
procedure ShowMessage( Option: Integer );
begin
case Option of
0: writeln( 'Toy is sleeping!' );
1: writeln( 'Toy is laughing!' );
2: writeln( 'Toy is crying!' );
3: writeln( 'Toy is singing!' );
else
writeln( 'The Option you chose does not exist!' );
end;
end;
begin
ShowMenu;
read( Option );
while Option <> 4 do
begin
ShowMessage( Option );
read( Option );
end;
end.