esercitazione a livello didattico-liceale
con turbo pascal , su argomenti di chimica vari

richiesta di tipo di legame in composti da inserire

 

program polare2;
(* determinazione tipo di legame tra elementi INTERATTIVO *)
uses crt;
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;


procedure datipolari;
begin
n[1]:='H';p[1]:=1;e[1]:=2.1;
n[2]:='He';p[2]:=4;e[2]:=0;
n[3]:='Li';p[3]:=7;e[3]:=1;
n[4]:='Be';p[4]:=9;e[4]:=1.5;
n[5]:='B';p[5]:=11;e[5]:=2;
n[6]:='C';p[6]:=12;e[6]:=2.5;
n[7]:='N';p[7]:=14;e[7]:=3;
n[8]:='O';p[8]:=16;e[8]:=3.5;
n[9]:='F';p[9]:=19;e[9]:=4;
n[10]:='Ne';p[10]:=20;e[10]:=0;
n[11]:='Na';p[11]:=23;e[11]:=0.9;
n[12]:='Mg';p[12]:=24;e[12]:=1.2;
n[13]:='Al';p[13]:=27;e[13]:=1.5;
n[14]:='Si';p[14]:=28;e[14]:=1.8;
n[15]:='P';p[15]:=31;e[15]:=2.1;
n[16]:='S';p[16]:=32;e[16]:=2.5;
n[17]:='Cl';p[17]:=35;e[17]:=3;
n[18]:='Ar';p[18]:=40;e[18]:=0;
n[19]:='K';p[19]:=39;e[19]:=0.8;
n[20]:='Ca';p[20]:=40;e[20]:=1;
n[21]:='Sc';p[21]:=45;e[21]:=1.3;
n[22]:='Ti';p[22]:=48;e[22]:=1.6;
n[23]:='V';p[23]:=51;e[23]:=1.6;
n[24]:='Cr';p[24]:=52;e[24]:=1.6;
n[25]:='Mn';p[25]:=55;e[25]:=1.5;
n[26]:='Fe';p[26]:=56;e[26]:=1.8;
n[27]:='Co';p[27]:=59;e[27]:=1.8;
n[28]:='Ni';p[28]:=59;e[28]:=1.8;
n[29]:='Cu';p[29]:=64;e[29]:=1.9;
n[30]:='Zn';p[30]:=65;e[30]:=1.6;
n[31]:='Ga';p[31]:=70;e[31]:=1.6;
n[32]:='Ge';p[32]:=73;e[32]:=1.8;
n[33]:='As';p[33]:=75;e[33]:=2;
n[34]:='Se';p[34]:=79;e[34]:=2.4;
n[35]:='Br';p[35]:=80;e[35]:=2.8;
n[36]:='Kr';p[36]:=84;e[36]:=0;
n[37]:='Rb';p[37]:=85;e[37]:=0.8;
n[38]:='Sr';p[38]:=88;e[38]:=1;
n[39]:='Y';p[39]:=89;e[39]:=1.2;
n[40]:='Zr';p[40]:=91;e[40]:=1.4;
n[41]:='Nb';p[41]:=93;e[41]:=1.6;
n[42]:='Mo';p[42]:=96;e[42]:=1.8;
n[43]:='Tc';p[43]:=99;e[43]:=1.9;
n[44]:='Ru';p[44]:=101;e[44]:=2.2;
n[45]:='Rh';p[45]:=103;e[45]:=2.2;
n[46]:='Pd';p[46]:=106;e[46]:=2.2;
n[47]:='Ag';p[47]:=108;e[47]:=1.9;
n[48]:='Cd';p[48]:=112;e[48]:=1.7;
n[49]:='In';p[49]:=115;e[49]:=1.7;
n[50]:='Sn';p[50]:=119;e[50]:=1.8;
n[51]:='Sb';p[51]:=122;e[51]:=1.9;
n[52]:='Te';p[52]:=128;e[52]:=2.1;
n[53]:='I';p[53]:=127;e[53]:=2.5;
n[54]:='Xe';p[54]:=131;e[54]:=0;
n[55]:='Cs';p[55]:=133;e[55]:=0.7;
n[56]:='Ba';p[56]:=137;e[56]:=0.9;
n[57]:='La';p[57]:=139;e[57]:=1.1;
n[58]:='Ce';p[58]:=140;e[58]:=1.1;
n[59]:='Pr';p[59]:=141;e[59]:=1.1;
n[60]:='Nd';p[60]:=144;e[60]:=1.2;
n[61]:='Pm';p[61]:=145;e[61]:=1.2;
n[62]:='Sm';p[62]:=150;e[62]:=1.2;
n[63]:='Eu';p[63]:=152;e[63]:=1.2;
n[64]:='Gd';p[64]:=157;e[64]:=1.1;
n[65]:='Tb';p[65]:=159;e[65]:=1.2;
n[66]:='Dy';p[66]:=162;e[66]:=1.2;
n[67]:='Ho';p[67]:=165;e[67]:=1.2;
n[68]:='Er';p[68]:=167;e[68]:=1.2;
n[69]:='Tm';p[69]:=169;e[69]:=1.2;
n[70]:='Yb';p[70]:=173;e[70]:=1.1;
n[71]:='Lu';p[71]:=174;e[71]:=1.2;
n[72]:='Hf';p[72]:=178;e[72]:=1.3;
n[73]:='Ta';p[73]:=181;e[73]:=1.5;
n[74]:='W';p[74]:=184;e[74]:=1.7;
n[75]:='Re';p[75]:=186;e[75]:=1.9;
n[76]:='Os';p[76]:=190;e[76]:=2.2;
n[77]:='Ir';p[77]:=192;e[77]:=2.2;
n[78]:='Pt';p[78]:=195;e[78]:=2.2;
n[79]:='Au';p[79]:=197;e[79]:=2.4;
n[80]:='Hg';p[80]:=201;e[80]:=1.9;
n[81]:='Tl';p[81]:=204;e[81]:=1.8;
n[82]:='Pb';p[82]:=207;e[82]:=1.8;
n[83]:='Bi';p[83]:=209;e[83]:=1.9;
n[84]:='Po';p[84]:=209;e[84]:=2;
n[85]:='At';p[85]:=210;e[85]:=2.2;
n[86]:='Rn';p[86]:=222;e[86]:=0;
n[87]:='Fr';p[87]:=223;e[87]:=0.7;
n[88]:='Ra';p[88]:=226;e[88]:=0.9;
n[89]:='Ac';p[89]:=227;e[89]:=1.1;
n[90]:='Th';p[90]:=232;e[90]:=1.3;
n[91]:='Pa';p[91]:=231;e[91]:=1.5;
n[92]:='U';p[92]:=238;e[92]:=1.7;
end;

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;
var lcp,lco,lio:string;
    r,x:integer;
begin
lcp:='legame covalente polare ';
lco:='legame covalente omopolare ';
lio:='legame ionico ';
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);
if h3<0.2 then r:=1 else
if ((h3>0.2) and (h3<1.7)) then r:=2 else
r:=3;
if r=1 then legame:=lco else if r=2 then legame:=lcp else legame:=lio;
writeln('tipo di legame :');
writeln('1 se covalente omopolare ');
writeln('2 se covalente polare ');
writeln('3 se ionico ');
write('scrivi la risposta 1,2,3 ? ');readln(x);
if x=r then writeln('esatto:',legame) else 
writeln('errato:era ',r,' ',legame);
writeln('--------------------------------------------------------------');
writeln('stampa valori elettronegativita e calcola differenza ');
writeln(e1:8,h1:8:2,e2:8,h2:8:2,'De=':8,h3:8:2);
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
clrscr;
writeln('seleziona  problema o fine');
writeln('1...cerca legame');
writeln('9...fine ');
write('opzione=');readln(s);
clrscr;
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
clrscr;
writeln('programma:determina tipo legame chimico tra elementi');
writeln('---------------------------------------------------');
writeln('premi enter');readln;
scelta;
end.

 

 

 

 

 

 

ritorna