esercizi di chimica con turbo pascal 1.1 su mac

 

 

Program reazione6;
(* test interattivo con conteggio risposte *)
(* test su reazioni chimiche e BILANCIAMENTO *)
const n=14;
   VAR
          a,esatte,errate,totale,restanti:integer;
          s:string;
          r:array[1..n] of string;
          b:array[1..n] of string;
procedure cancella;
begin
clearscreen;
end;
procedure dati;
begin
b[1]:='1CaO + 1H2O ----------->1Ca(OH)2';
b[2]:='1Mg(OH)2 + 2HCl ------>1MgCl2 + 2H2O';
b[3]:='1SO3 + 1Na2O --------->1Na2SO4';
b[4]:='1Zn + 2HNO3 ---------->1Zn(NO3)2 + 1H2';
b[5]:='2Fe + O2 ------------>2Fe0';
b[6]:='2Cl2 + 5O2 ----------->2Cl205';
b[7]:='1N2O3+ 1H2O ---------->2HNO2';
b[8]:='1FeO + 2HClO --------->1Fe(ClO)2 + 1H2O';
b[9]:='3H2 + 2Al ------------>2AlH3';
b[10]:='1F2+ 1H2 ------------>2HF';
b[11]:='2NaOH + 1N2O5 ------->2NaNO3 + 1H2O';
b[12]:='2NaCl + 1H2SO4 ------>1Na2SO4 + 2HCl';
b[13]:='1AgNO3 + 1KCl ------->1KNO3 + 1AgCl';
b[14]:='1CaCO3  ------------>1CaO + 1CO2';
r[1]:='2';
r[2]:='5';
r[3]:='2';
r[4]:='4';
r[5]:='1';
r[6]:='1';
r[7]:='2';
r[8]:='5';
r[9]:='1';
r[10]:='1';
r[11]:='5';
r[12]:='5';
r[13]:='5';
r[14]:='3';
end;
begin
cancella;
dati;
writeln('indicare tipo di reazione,scrivendo un numero come indicato');
writeln('sintesi:1...combinazione:2..decomposizione:3');
writeln('spostamento:4...doppio scambio:5...');
writeln('se non li conosci,premi INVIO ');
writeln('esempio ');
writeln('  KOH + H2SO3 --------->K2SO3 + H2O ----->5');
writeln('------------------------------------------------------');
writeln('premi INVIO');readln;
esatte:=0;errate:=0;totale:=0;restanti:=0;
for a:=1 to n do
begin
cancella;
writeln('sintesi:1...combinazione:2..decomposizione:3');
writeln('spostamento:4...doppio scambio:5...');
writeln('se non li conosci,premi INVIO ');
 write(b[a]);write('---------->');
 readln(s);
 if s=r[a] then 
 begin writeln('esatto');esatte:=esatte+1;end
  else begin write('errato,era : ');writeln(r[a]);
  errate:=errate+1;end;restanti:=n-(esatte+errate);
 writeln('--------------------------------------------------');
 writeln('esatte=',esatte,'  errate=',errate,'  restanti=',restanti);
 writeln('====================================================');
 WRITELN('premi INVIO');readln;
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.