polarità legami chimici

program polare1;
(* determinazione tipo di legame tra elementi DIMOSTRATIVO *)
const k=92;
var n:array[1..k] of string;
    p:array[1..k] of integer;
    e:array[1..k] of real;
    s,a:integer; 
    h1,h2,h3:real;
    e1,e2,legame:string; 
{$I datipolari}
procedure fine;
begin
writeln('premi enter');
readln;
end;
procedure pausa;
begin
writeln('premi ENTER ');readln;
end;
procedure cerca1;
begin
datipolari;
for a:=1 to k do
if e1=n[a] then h1:=e[a];
end;
procedure cerca2;
begin
datipolari;
for a:=1 to k do
if e2=n[a] then h2:=e[a];
end;
procedure pro1;
begin
write('scrivi simbolo primo elemento   ');readln(e1);
cerca1;
write('scrivi simbolo secondo elemento ');readln(e2);
cerca2;
WRITELN('------------------------------------------------');
writeln('legame covalente omopolare se De <0.2 ');
writeln('legame covalente polare    se 0.2 < De < 1.7 ');
writeln('legame ionico              se De >=1.7');
writeln('===============================================================');
h3:=abs(h1-h2);
writeln('stampa valori elettronegativita e calcola differenza ');
WRITELN(e1:8,e2:8,'De':8);
writeln(h1:8:2,h2:8:2,h3:8:2);
if h3<0.2 then legame:='legame covalente omopolare' else
if ((h3>0.2) and (h3<1.7)) then legame:='legame covalente polare' else
legame:='legame ionico';
writeln('legame tra elementi tipo :',legame);
writeln('--------------------------------------------------------------');
writeln('carica parziale o totale positiva:elemento meno elettronegativo');
writeln('carica parziale o totale negativa:elemento piu  elettronegativo');
if ((h3>0.2) and (h3<1.7) and (h1<h2)) then writeln(e1,' +d   ',e2,' -d');
if ((h3>0.2) and (h3<1.7) and (h1>h2)) then writeln(e2,' +d   ',e1,' -d');
if ((h3=1.7) or (h3>1.7) and (h1<h2)) then writeln(e1,' +   ',e2,' -');
if ((h3=1.7) or (h3>1.7) and (h1>h2)) then writeln(e2,' +   ',e1,' -');
end;
procedure scelta;
var ancora:integer;
begin
clearscreen;
writeln('seleziona  problema o fine');
writeln('1...cerca legame');
writeln('9...fine ');
write('opzione=');readln(s);
clearscreen;
case s of
1:pro1;
9:fine;
end;
writeln('----------------------------');
writeln('altro problema:scrivi 1...fine:scrivi 2 ');readln(ancora);
if ancora =1 then scelta else fine;
end;
begin
clearscreen;
writeln('programma:determina tipo legame chimico tra elementi');
writeln('---------------------------------------------------');
writeln('premi enter');readln;
scelta;
end.