esercizi di chimica con turbo pascal 1.1 su mac

Program bilan1;
(* test interattivo con conteggio risposte *)
(* test su reazioni chimiche e bilanciamento interattivo *)
const n=13;
   VAR
          a,esatte,errate,totale,restanti:integer;
          s:string;
          d:array[1..n] of string;
          r:array[1..n] of string;
          c:array[1..n] of string;
procedure cancella;
begin
clearscreen;
end;
procedure dati;
begin
d[1]:='NaOH + H2SO4 ----> Na2SO4 + H2O ';
d[2]:='CaO + HCl -----> CaCl2 + H2O';
d[3]:='Al2O3 + HCl ---> AlCl3 + H20';
d[4]:='Mg(OH)2 + HCl ---> MgCl2 + H2O';
d[5]:='KOH + HNO3 -----KNO3 + H2O';
d[6]:='CaO + HNO2 -----> Ca(NO2)2 + H20';
d[7]:='Na2O + CO2 -----> Na2CO3 ';
d[8]:='Al2O3 + CO2 ----> Al2(CO3)3';
d[9]:='Fe(OH)3 + H2SO3 --> Fe2(SO3)3 + H2O';
d[10]:='CuO + HNO3 -----> Cu(NO3)2 + H20';
d[11]:='PbO2 + HCl ----> PbCl4 + H20';
d[12]:='SnO + HNO3 ----> Sn(NO3)2 + H20';
d[13]:='Cu(OH)2 + HClO ----> Cu(ClO)2 + H20';
r[1]:='2NaOH + 1H2SO4 -----> 1Na2SO4 + 2H2O ';
r[2]:='1CaO + 2HCl -----> 1CaCl2 + 1H2O';
r[3]:='1Al2O3 + 6HCl ---> 2AlCl3 + 3H20';
r[4]:='1Mg(OH)2 + 2HCl ---> 1MgCl2 + 2H2O';
r[5]:='1KOH + 1HNO3 -----  1KNO3 + 1H2O';
r[6]:='1CaO + 2HNO2 -----> 1Ca(NO2)2 + 1H20';
r[7]:='1Na2O + 1CO2 -----> 1Na2CO3 ';
r[8]:='1Al2O3 + 3CO2 ----> 1Al2(CO3)3';
r[9]:='2Fe(OH)3 + 3H2SO3 --> 1Fe2(SO3)3 + 6H2O';
r[10]:='1CuO + 2HNO3 -----> 1Cu(NO3)2 + 1H20';
r[11]:='1PbO2 + 4HCl ----> 1PbCl4 + 2H20';
r[12]:='1SnO + 2HNO3 ----> 1Sn(NO3)2 + 1H20';
r[13]:='1Cu(OH)2 + 2HClO ----> 1Cu(ClO)2 + 2H20';
c[1]:='2,1,1,2';c[2]:='1,2,1,1'; c[3]:='1,6,2,3';  c[4]:='1,2,1,2';
c[5]:='1,1,1,1';  c[6]:='1,2,1,1';  c[7]:='1,1,1';  c[8]:='1,3,1'; 
c[9]:='2,3,1,6';  c[10]:='1,2,1,1';  c[11]:='1,4,1,2';  c[12]:='1,2,1,1';
c[13]:='1,2,1,2'; 
end;
begin
cancella;
dati;
writeln('scrivi i coefficienti per bilanciare la reazione');
writeln('------------------------------------------------------');
esatte:=0;errate:=0;totale:=0;restanti:=0;
for a:=1 to n do
begin
 write(d[a]);write('---------->');
 readln(s);
 if s=c[a] then 
 begin writeln('esatto');
 writeln(r[a]);esatte:=esatte+1;end
  else begin writeln('errato,era : ');
  writeln(c[a]);writeln(r[a]);
  errate:=errate+1;end;
  restanti:=n - (esatte+errate);
  writeln('--------------------------------------------------');
  writeln('esatte=',esatte,' errate=',errate,' rimanenti=',restanti);
 writeln('====================================================');
end;
totale:=esatte+errate;
writeln('premi INVIO per finire ');readln;cancella;
writeln('risposte esatte =',esatte, ' su totale domande=',totale);
writeln('risposte errate =',errate, ' su totale domande=',totale);
writeln('chiama insegnante per valutazione,poi premi INVIO'); 
readln;cancella;
end.