Well, you used this sort of structure a few times:
Code:
repeat
  ...
  readln(key);
  key := upcase(key);
until (key = 'Y') or (key = 'N');
if (key = 'N') then begin
  ...
end;
if (key = 'Y') then begin
  ...
end;
Whereas it should be written:
Code:
if (key = 'N') then begin
  ...
end
else if (key = 'Y') then begin
  ...
end;
Because then it will only check the first IF and ignore the other condition entirely (if 'N' was entered). In the first code it checks both codes which is extra work for CPU, and a possible cause for logic errors in program.

PS. Tested the WYSIWYG style but had to take it off because i don't know how to use it. If you start writing with code tags, how do you put cursor behind it and continue in normal font?