listati per programmi in turbo pascal
su argomenti di chimica, con interazione e correzione

 

 

program ossida4;
(* terminologia reazioni redox con valutazione finale *)
uses crt;
const n=20;
var a,b,esatte,errate:integer;
    ox,rd:string[5];
    s:array[1..n] of string[200];
    os:array[1..n] of string[5];
    ri:array[1..n] of string[5];
    no:array[1..n] of string[15];
    nr:array[1..n] of string[15];

procedure cancella;
begin
clrscr;
end;
   
procedure dati;
begin
 s[1]:='2H2 + O2 -----> 2 H2O ';os[1]:='O';ri[1]:='H';
 no[1]:='0..-2';nr[1]:='0..+1';
 s[2]:='H2 + Cl2 -----> 2 HCl ';os[2]:='Cl';ri[2]:='H'; 
 no[2]:='0..-1';nr[2]:='0..+1';  
 s[3]:='3H2 + N2 -----> 2 NH3 ';os[3]:='N';ri[3]:='H';
 no[3]:='0..-3';nr[3]:='0..+1';
 s[4]:='H2 + S -----> H2S ';os[4]:='S';ri[4]:='H';
 no[4]:='0..-2';nr[4]:='0..+1';
 s[5]:='S + O2 -----> SO2 ';os[5]:='O';ri[5]:='S';
 no[5]:='0..-2';nr[5]:='0..+4';
 s[6]:='Zn + 2HCl -----> ZnCl2 + H2 ';os[6]:='H';ri[6]:='Zn';
 no[6]:='+1..0';nr[6]:='0..+2';
 s[7]:='Fe + CuSO4 -----> FeSO4 + Cu ';os[7]:='Cu';ri[7]:='Zn';
 no[7]:='+2..0';nr[7]:='0..+2';
 s[8]:='Cu + AgNO3 -----> CuNO3 + Ag ';os[8]:='Ag';ri[8]:='Cu';
 no[8]:='+1..0';nr[8]:='0..+1';
 s[9]:='4Al + 3O2 -----> 2Al2O3 ';os[9]:='O';ri[9]:='Al'; 
 no[9]:='0..-2';nr[9]:='0..+3';
 s[10]:='C + O2 -----> CO2 ';os[10]:='O';ri[10]:='C';   
 no[10]:='0..-2';nr[10]:='0..+4';
 s[11]:='P + HNO3 + H2O ----> H3PO4 + NO ';os[11]:='N';ri[11]:='P';
 no[11]:='+5..+2';nr[11]:='0..+5';
 s[12]:='Cu + H2SO4 ---->CuSO4 + SO2 + H2O  ';os[12]:='S';ri[12]:='Cu';
 no[12]:='+6..+4';nr[12]:='0..+2';
  s[13]:='Cu + HNO3 ---->Cu(NO3)2 + NO + H2O  ';os[13]:='N';ri[13]:='Cu';
  no[13]:='+5..+2';nr[13]:='0..+2';
   s[14]:='Ag + HClO3 + HCl ---->AgCl + H2O  ';os[14]:='Cl';ri[14]:='Ag';
   no[14]:='+5..-1';nr[14]:='0..+1';
  s[15]:='FeCl2 + SnCl4 ---->FeCl3 + SnCl2  ';os[15]:='Sn';ri[15]:='Fe';
  no[15]:='+4..+2';nr[15]:='+2..+3';
   s[16]:='NH3 + O2 ---->NO + H2O  ';os[16]:='O';ri[16]:='N';
   no[16]:='0..-2';nr[16]:='-3..+2';
   s[17]:='KMnO4 + HCl ----> KCl + MnCl2 +Cl2 H2O ';os[17]:='Mn';ri[17]:='Cl';
   no[17]:='+7..+2';nr[17]:='-1..0';
   s[18]:='KBrO3 + HBr + FeBr2 ---->FeBr3 + KBr+H2O';os[18]:='Br';ri[18]:='Fe';
   no[18]:='+5..-1';nr[18]:='+2..+3';
   s[19]:='Cl2+NaOH ---->NaCl+NaClO+H2O  ';os[19]:='Cl';ri[19]:='Cl';
   no[19]:='0..-1';nr[19]:='0..+1';
    s[20]:='NaNO2+H2SO4 ---->NaHSO4+HNO3+NO+H2O  ';os[20]:='N';ri[20]:='N';
    no[20]:='+3..+2';nr[20]:='+3..+5';

end;

procedure test;
begin
esatte:=0;errate:=0;
dati;
 for a:=1 to b do
 begin
 writeln('reazione redox da esaminare ');
 writeln('si deve assegnare il numero di ossidazione ad ogni elemento');
 writeln('scrivendo su carta');
 writeln('si deve quindi osservare elemento che si ossida ,riduce ');
 writeln('si devono scrivere i simboli dello elemento ossidante,riducente');
 writeln('---------------------------------------------------------------');
 writeln(s[a]);writeln;
 write('simbolo ossidante  =');readln(ox);
 write('simbolo riducente  =');readln(rd);
   if ox=os[a] then begin
    writeln('esatto:ossidante=',ox);
    esatte:=esatte+1;end
   else begin writeln('errato:era ossidante=',os[a]);end;
   if rd=ri[a] then begin
   writeln('esatto:riducente=',rd);esatte:=esatte+1;end
   else writeln('errato:era riducente=',ri[a]);
   writeln;
   writeln('--------------------------------------------------');
   writeln('confronta i cambiamenti di numeri di ossidazione ');
   writeln('elemento ossidante  :',no[a]);
   writeln('elemento riducente  :',nr[a]);
   writeln('--------------------------------------------------');
   writeln('premi INVIO');readln;cancella;
 end;
 end;
 
begin
cancella;
repeat
write('indica numero di prove da eseguire <21 ');readln(b);
until b<21;
cancella;
test;
writeln('risultato prova');
errate:=2*b-esatte;
writeln('esatte=',esatte);
writeln('errate=',errate);
writeln('chiama insegnante per valutazione:spera in bene...');
writeln('poi premi INVIO');
readln;cancella;
end.

   
   
 

program polare6;
(* determinazione tipo di legame tra elementi DIMOSTRATIVO *)
uses crt;
const k=92;
var n:array[1..k] of string;
    p:array[1..k] of integer;
    e:array[1..k] of real;
    (*fx:array[1..40] of string[15];*)
    s,a,f,prove:integer;
    h1,h2,h3,h4:real;
    e1,e2,legame:string;


procedure fine;
begin
writeln('premi enter');
readln;
end;

procedure pausa;
begin
writeln('premi ENTER ');readln;
end;

procedure cancella;
begin
clrscr;
end;

procedure datipo;
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 cerca1;
begin
datipo;
for a:=1 to k do
if e1=n[a] then h1:=e[a];
end;

procedure cerca2;
begin
datipo;
for a:=1 to k do
if e2=n[a] then h2:=e[a];
end;

procedure pro1(sf:string);
begin
writeln('esempio ',sf);
writeln('------------------------------------------');
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 pro2(sf:string);
begin
writeln('esempio ',sf);
writeln('------------------------------------------');
write('scrivi simbolo metallo   ');readln(e1);
cerca1;
h3:=3.5-h1;
h2:=1.4;
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('stampa valori elettronegativita e calcola differenze ');
writeln(e1:8,h1:8:2,'O':8,3.5:8:2,'H':8,2.1:8:2);
writeln('De tra Ossigeno e     ',e1:8,' = ',h3:0:2,' legame ionico');
writeln('De tra Ossigeno e Idrogeno     = 1.4..legame covalente polare');
end;

procedure pro3(sf:string);
var le:string;
begin
writeln('esempio ',sf);
writeln('------------------------------------------');
write('scrivi simbolo elemento intermedio S,N,P,Cl..   ');readln(e1);
cerca1;
h3:=3.5-h1;
h2:=1.4;
if h3<1.7 then le:=' legame covalente polare' else le:=' legame ionico';
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('stampa valori elettronegativita e calcola differenze ');
writeln(e1:8,h1:8:2,'O':8,3.5:8:2,'H':8,2.1:8:2);
writeln('De tra Ossigeno e     ',e1:8,' = ',h3:0:2,le:8);
writeln('De tra Ossigeno e Idrogeno     = 1.4..legame covalente polare');
end;

procedure pro6(sf:string);
var le:string;
begin
writeln('esempio ',sf);
writeln('------------------------------------------');
write('scrivi simbolo metallo ..K..Ca..Na..            ');readln(e2);
cerca2;
h4:=3.5-h2;
write('scrivi simbolo elemento intermedio S,N,P,Cl..   ');readln(e1);
cerca1;
h3:=3.5-h1;
if h3<1.7 then le:=' legame covalente polare' else le:=' legame ionico';
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('stampa valori elettronegativita e calcola differenze ');
writeln(e2:8,h2:8:2,e1:8,h1:8:2,'O':8,3.5:8:2);
writeln('De tra Ossigeno e     ',e1:8,' = ',h3:0:2,le:8);
writeln('De tra Ossigeno e     ',e2:8,' = ',h4:0:2,' legame ionico');
end;

procedure scelta;
var ancora:integer;
begin
cancella;
f:=0;
repeat
f:=f+1;
if f>39 then f:=1;
(* writeln('tipo formula da analizzare ',fx[f]); *)
writeln('seleziona  problema o fine');
writeln('1...cerca legame tra due atomi o elementi..    HCl..H2..NaF..');
writeln('2...cerca legame tra elementi  in idrossido    NaOH..Ca(OH)2.');
writeln('3...cerca legame tra elementi  in ossiacidi    HNO3..H2SO4 ');
writeln('4...cerca legame tra due atomi in ossidi o anidridi CaO..SO3..');
writeln('5...cerca legame tra atomi in  sali ossigenati.NaNO3...');
writeln('6...cerca legame tra atomi in  sali binari  .. KCl..K2S..NaF..');
writeln('9...fine ');
write('opzione=');readln(s);
cancella;
case s of
1:pro1('HCl..H2..NaF..');
2:pro2('NaOH..KOH..');
3:pro3('HNO3..H2SO4..');
4:pro1('CaO...SO2..');
5:pro6('NaNO3..CaSO4..');
6:pro1('KCl..K2S..NaBr..');
9:fine;
end;
writeln('----------------------------');
writeln('altro problema:scrivi 1...fine:scrivi 2 ');readln(ancora);cancella;
until ancora=2;
end;


begin
cancella;
writeln('programma:determina tipo legame chimico tra elementi');
writeln('---------------------------------------------------');
repeat
write('indica numero prove <40 :');readln(prove);
until prove<40;
writeln('premi enter');readln;
scelta;
end.

program OSSIDA;
(* determinazione numero ossidazione elementi composto INTERATTIVO *)
(* senza valutazione finale *)
uses crt;
const k1=64;

var n:array[1..k1] of string;
    q:array[1..k1] of integer;
    va:array[1..k1] of integer;
    s,a,d,x,n1,n2,n3,h1,h2,h3,hy,v1,v2,h2y,h2f,totale,f,k:integer;
    y,e1,e2,e3:string;
    hx:real;
    fx:array[1..40] of string[15];

procedure datiy;
begin
n[1]:='Li';va[1]:=1;q[1]:=1;
n[2]:='Na';va[2]:=1;q[2]:=1;
n[3]:='K';va[3]:=1;q[3]:=1;
n[4]:='Rb';va[4]:=1;q[4]:=1;
n[5]:='Cs';va[5]:=1;q[5]:=1;
n[6]:='Fr';va[6]:=1;q[6]:=1;
n[7]:='Be';va[7]:=2;q[7]:=1;
n[8]:='Mg';va[8]:=2;q[8]:=1;
n[9]:='Ca';va[9]:=2;q[9]:=1;
n[10]:='Sr';va[10]:=2;q[10]:=1;
n[11]:='Ba';va[11]:=2;q[11]:=1;
n[12]:='Ra';va[12]:=2;q[12]:=1;
n[13]:='Sc';va[13]:=3;q[13]:=1;
n[14]:='Y';va[14]:=3;q[14]:=1;
n[15]:='La';va[15]:=3;q[15]:=1;
n[16]:='Ac';va[16]:=3;q[16]:=1;
n[17]:='Zr';va[17]:=4;q[17]:=1;
n[18]:='Hf';va[18]:=4;q[18]:=1;
n[19]:='Ku';va[19]:=4;q[19]:=1;
n[20]:='Ta';va[20]:=5;q[20]:=1;
n[21]:='Ag';va[21]:=1;q[21]:=1;
n[22]:='Cd';va[22]:=2;q[22]:=1;
n[23]:='Zn';va[23]:=2;q[23]:=1;
n[24]:='Al';va[24]:=3;q[24]:=1;
n[25]:='Ga';va[25]:=3;q[25]:=1;
n[26]:='In';va[26]:=3;q[26]:=1;
n[27]:='Ti';va[27]:=3;q[27]:=2;
n[28]:='Ti';va[28]:=4;q[28]:=2;
n[29]:='V';va[29]:=2;q[29]:=2;
n[30]:='V';va[30]:=3;q[30]:=2;
n[31]:='Cr';va[31]:=2;q[31]:=2;
n[32]:='Cr';va[32]:=3;q[32]:=2;
n[33]:='Mo';va[33]:=2;q[33]:=2;
n[34]:='Mo';va[34]:=3;q[34]:=2;
n[35]:='Mn';va[35]:=2;q[35]:=2;
n[36]:='Mn';va[36]:=3;q[36]:=2;
n[37]:='Fe';va[37]:=2;q[37]:=2;
n[38]:='Fe';va[38]:=3;q[38]:=2;
n[39]:='Co';va[39]:=2;q[39]:=2;
n[40]:='Co';va[40]:=3;q[40]:=2;
n[41]:='Ni';va[41]:=2;q[41]:=2;
n[42]:='Ni';va[42]:=3;q[42]:=2;
n[43]:='Pd';va[43]:=2;q[43]:=2;
n[44]:='Pd';va[44]:=4;q[44]:=2;
n[45]:='Pt';va[45]:=2;q[45]:=2;
n[46]:='Pt';va[46]:=4;q[46]:=2;
n[47]:='Cu';va[47]:=1;q[47]:=2;
n[48]:='Cu';va[48]:=2;q[48]:=2;
n[49]:='Au';va[49]:=1;q[49]:=2;
n[50]:='Au';va[50]:=3;q[50]:=2;
n[51]:='Hg';va[51]:=1;q[51]:=2;
n[52]:='Hg';va[52]:=2;q[52]:=2;
n[53]:='Sn';va[53]:=2;q[53]:=2;
n[54]:='Sn';va[54]:=4;q[54]:=2;
n[55]:='Pb';va[55]:=2;q[55]:=2;
n[56]:='Pb';va[56]:=4;q[56]:=2;
n[57]:='Sb';va[57]:=3;q[57]:=2;
n[58]:='Bi';va[58]:=3;q[58]:=2;
n[59]:='Po';va[59]:=2;q[59]:=2;
n[60]:='Po';va[60]:=4;q[60]:=2;
n[61]:='Th';va[61]:=4;q[61]:=2;
n[62]:='Nd';va[62]:=3;q[62]:=2;
n[63]:='U';va[63]:=3;q[63]:=2;
n[64]:='Co';va[64]:=4;q[64]:=2;
end;


procedure formule;
begin
fx[1]:='HNO3';fx[2]:='HClO4';fx[3]:='H2SO4';fx[4]:='HClO2';
fx[5]:='H3PO4';fx[6]:='H2SO4';fx[7]:='H2CO3';fx[8]:='HClO';
fx[9]:='NaNO3';fx[10]:='K2SO3';fx[11]:='ZnSO4';fx[12]:='KNO2';
fx[13]:='NaClO4';fx[14]:='CaSO3';fx[15]:='KClO2';fx[16]:='CaCO3';
fx[17]:='SO3';fx[18]:='CO2';fx[19]:='SO2';fx[20]:='N2O5';
fx[21]:='CaCl2';fx[22]:='CaF2';fx[23]:='NaF';fx[24]:='BaCl2';
fx[25]:='KOH';fx[26]:='Ca(OH)2';fx[27]:='Mg(OH)2';fx[28]:='Al(OH)3';
fx[29]:='NaOH';
fx[30]:='HCl';fx[31]:='HF';fx[32]:='H2S';fx[33]:='HBr';fx[34]:='HI';
fx[35]:='SnO';fx[36]:='PbO2';fx[37]:='CaO';fx[38]:='MgO';
fx[39]:='Al2O3';fx[40]:='Fe2O3' ;

end;

procedure cancella;
begin;
clrscr;
end;


procedure fine;
begin
writeln('premi enter');
readln;
end;

procedure pausa;
begin
writeln('premi ENTER ');readln;
end;

procedure pro1;
begin
WRITELN('formula OSSIACIDO ');
for k:=1 to 8 do
 writeln(fx[k]);
writeln('scrivi simboli elementi e loro indici o numero di atomi');
 write('indice o numero atomi IDROGENO   ');readln(n1);
 write('simbolo non metallo              ');readln(e2);
 write('indice o numero atomi elemento   ');readln(n2);
 write('indice o numero atomi OSSIGENO   ');readln(n3);
 e1:='H';e3:='O';
 h2:=n3*2-n1*1;
 writeln('-----------------------------------------------------');
 writeln('scrivi numeri ossidazione preceduti da segno + o - ');
 writeln(e1,n1,e2,n2,e3,n3);
 write('numero ossidazione di ',e1);readln(x);
 if x=+1 then writeln('esatto ') else writeln('errato:era +1 ');
 write('numero ossidazione di ',e2);readln(x);
 if x=+h2 then writeln('esatto ') else writeln('errato:era +',h2);
 write('numero ossidazione di ',e3);readln(x);
 if x=-2 then writeln('esatto ') else writeln('errato:era -2 ');
 end;


procedure pro2;
begin
writeln('formula IDROSSIDO ');
for k:=25 to 29 do
 writeln(fx[k]);
writeln('scrivi simboli elementi e loro indici o numero di atomi');
 write('simbolo elemento metallico       ');readln(e1);
 write('indice o numero atomi OSSIGENO   ');readln(n2);
 e2:='O';e3:='H';n1:=1;
 h1:=n2;
 writeln('-----------------------------------------------------');
 writeln(e1,e2,n2,e3,n2);
 writeln(e1,'(',e2,e3,')',n2);
 writeln('scrivi numeri ossidazione preceduti da segno + o - ');
 write('numero ossidazione di ',e1);readln(x);
 if x=+h1 then writeln('esatto ') else writeln('errato:era +',h1);
 write('numero ossidazione di ',e2);readln(x);
 if x=-2 then writeln('esatto ') else writeln('errato:era -2 ');
 write('numero ossidazione di ',e3);readln(x);
 if x=+1 then writeln('esatto ') else writeln('errato:era +1 ');
 end;


procedure pro3;
begin
writeln('formula IDRACIDO ');
for k:=30 to 34 do
 writeln(fx[k]);
writeln('scrivi simboli elementi e loro indici o numero di atomi');
 write('indice o numero atomi IDROGENO   ');readln(n1);
 write('simbolo radicale acido           ');readln(e2);
 e1:='H';
  WRITELN('-----------------------------------------------------');
  writeln('scrivi numeri ossidazione preceduti da segno + o - ');
   writeln(e1,n1,e2);
 write('numero ossidazione di ',e1);readln(x);
 if x=+1 then writeln('esatto ') else writeln('errato:era +1 ');
 write('numero ossidazione di ',e2);readln(x);
 if x=-n1 then writeln('esatto ') else writeln('errato:era -',n1);
 end;


procedure pro4;
begin
writeln('formula ANIDRIDE ');
for k:=17 to 20 do
 writeln(fx[k]);
writeln('scrivi simboli elementi e loro indici o numero di atomi');
writeln('es.SO3....N2O5...CaO....Al2O3...');
writeln('----------------------------------------------------------------');
writeln('calcola :TOTALE cariche negative=atomi ossigeno*(-2)');
writeln('calcola :N.OSSIDAZIONE elemento =totale negative/indice elemento');
writeln('----------------------------------------------------------------');
 write('simbolo elemento                 ');readln(e1);
 write('indice o numero atomi elemento   ');readln(n1);
 write('indice o numero atomi ossigeno   ');readln(n2);
 h1:=round(n2*2/n1);
  WRITELN('-----------------------------------------------------');
  writeln('scrivi numeri ossidazione preceduti da segno + o - ');
   writeln(e1,n1,'0',n2);
 write('numero ossidazione di ',e1);readln(x);
 if x=+h1 then writeln('esatto ') else writeln('errato:era +',h1);
 write('numero ossidazione di ','0');readln(x);
 if x=-2 then writeln('esatto ') else writeln('errato:era -2');
 end;


procedure pro5;
label salta2,salta;
begin
writeln('formula SALE binario ');
for k:=21 to 24 do
 writeln(fx[k]);
writeln('scrivi simboli elementi e loro indici o numero di atomi');
writeln('es.NaCl....CaF2...CaS..');
writeln('----------------------------------------------------------------');
writeln('calcola :TOTALE cariche negative=atomi alogeno*(-1)');
writeln('calcola :TOTALE cariche negative=atomi   zolfo*(-2)');
writeln('calcola :N.OSSIDAZIONE elemento =totale negative/indice elemento');
writeln('----------------------------------------------------------------');
 write('simbolo elemento metallico       ');readln(e1);
 write('indice o numero atomi elemento   ');readln(n1);
 write('simbolo radicale acido           ');readln(e2);
 write('indice o numero atomi radicale   ');readln(n2);
 if e2='S' then h3:=2*n2 else h3:=n2;
 h1:=round(h3/n1);
 writeln('----------------------------------------------');
  begin
  writeln('scrivi numeri ossidazione preceduti da segno + o - ');
   writeln(e1,n1,e2,n2);
 write('numero ossidazione di ',e1);readln(x);
 if x=+h1 then writeln('esatto ') else writeln('errato:era +',h1);
 write('numero ossidazione di ',e2);readln(x);
 if e2='S' then goto salta2 ;
 if (x=-1)  then writeln('esatto ') else writeln('errato:era -1');goto salta;
 salta2:
 if x=-2 then writeln('esatto ')  else writeln('errato:era -2');
 end;
 salta:
end;

procedure pro6;
begin
writeln('formula SALI OSSIGENATI ');
for k:=9 to 16 do
 writeln(fx[k]);
WRITELN('nel caso di metalli con piu valenze,usare solo la valenza maggiore');
WRITELN('1,2=2...2,3=3...2,4=4 essendo programma ancora incompleto ');
WRITELN('in caso contrario si avranno risposte non corrette ');
writeln('----------------------------------------------------------------');
writeln('scrivi simboli elementi e loro indici o numero di atomi');
writeln('es.NaNO3....CaSO4...Ca(NO3)2..');
 write('simbolo 1 elemento               ');readln(e1);
 write('indice o numero atomi elemento   ');readln(n1);
 writeln('cerco valenza metallo ');
 writeln('Cm =valenza*indice metallo');
 datiy;
 for a:=1 to k1 do
 if e1=n[a] then begin v1:=va[a];v2:=va[a+1];
                       h1:=va[a]*n1;hy:=va[a+1]*n1; end;
 write('simbolo 2 elemento               ');readln(e2);
 write('indice o numero atomi elemento   ');readln(n2);
 e3:='O';
 write('indice o numero atomi ossigeno   ');readln(n3);
 writeln('cariche negative Cn = -2*indice ossigeno  ');
 writeln('n.ossidazione ',e2,' (Cn-Cm)/indice elemento ',e2);
 h3:=2*n3; (* cariche negative ossigeno *)
 h2:=round((h3-h1)/n2); (* cariche positive elemento intermedio *)
 h2y:=round((h3-hy)/n2);
 if h2=(h3-h1)/n2 then h2f:=h2 else h2f:=h2y;
 writeln('-------------------------------------------------');
 writeln('scrivi i numeri di ossidazione preceduti da segno + o - ');
 writeln(e1,n1,e2,n2,e3,n3);
 writeln(e1,n1,'(',e2,e3,n3/n2:0:0,')',n2);
 write('elemento ',e1:8);readln(x);
 if x=v1 then writeln('esatto:') else writeln('errato:era ',v1);
 write('elemento ',e2:8);readln(x);
 if x=h2f then writeln('esatto:') else writeln('errato:era ',h2f);
 write('elemento ',e3:8);readln(x);
 if x=-2 then writeln('esatto:') else writeln('errato:era ',-2);
end;

procedure pro7;
begin
writeln('formula OSSIDO BASICO ');
for k:=35 to 40 do
 writeln(fx[k]);
writeln('scrivi simboli elementi e loro indici o numero di atomi');
writeln('es.SO3....N2O5...CaO....Al2O3...');
writeln('----------------------------------------------------------------');
writeln('calcola :TOTALE cariche negative=atomi ossigeno*(-2)');
writeln('calcola :N.OSSIDAZIONE elemento =totale negative/indice elemento');
writeln('----------------------------------------------------------------');
 write('simbolo elemento                 ');readln(e1);
 write('indice o numero atomi elemento   ');readln(n1);
 write('indice o numero atomi ossigeno   ');readln(n2);
 h1:=round(n2*2/n1);
  WRITELN('-----------------------------------------------------');
  writeln('scrivi numeri ossidazione preceduti da segno + o - ');
   writeln(e1,n1,'0',n2);
 write('numero ossidazione di ',e1);readln(x);
 if x=+h1 then writeln('esatto ') else writeln('errato:era +',h1);
 write('numero ossidazione di ','0');readln(x);
 if x=-2 then writeln('esatto ') else writeln('errato:era -2');
 end;

procedure scelta;
var ancora:integer;
begin
cancella;
f:=0;
repeat
cancella;
f:=f+1;
(* write('formula da esaminare ');writeln(fx[f]);*)
writeln('---------------------------------------------------------');
writeln('seleziona tipo problema ');
writeln('1...composti ternari come OSSIACIDI............H2SO4..HNO3 ');
writeln('2...composti ternari come IDROSSIDI............NaOH..Ca(OH)2');
writeln('3...composti binari come IDRACIDI..............HCl....H2S  ');
writeln('4...composti binari come ANIDRIDI..............N2O3...SO3  ');
writeln('5...composti binari come SALI di ALOGENI,ZOLFO.NaCl...CaS  ');
WRITELN('6...composti ternari come SALI OSSIGENATI......CaSO4..NaNO3');
writeln('7...composti binari come OSSIDI BASICI.........CaO....Al2O3');
writeln('9...fine ');
write('opzione=');readln(s);
cancella;
case s of
1:pro1;
2:pro2;
3:pro3;
4:pro4;
5:pro5;
6:pro6;
7:pro7;
9:fine;

end;
writeln('----------------------------');
writeln('altro problema:scrivi 1...fine:scrivi 2 ');readln(ancora);
until ancora=2;
fine;
end;


begin
cancella;
formule;
repeat
write('indica numero prove da eseguire <40 ');readln(totale);
until totale<40;
writeln('programma:richiesta assegnazione numeri ossidazione elementi');
writeln('---------------------------------------------------');
writeln('premi enter');readln;
scelta;
end.