titolazione

esci chimicaturbo.htm

Program tito3;
(* grafico per simulazione TITOLAZIONE INTERATTIVO di TITOLA3 *)

USES crt,graph;
const fondo:FillPatternType=(1,2,3,4,5,6,7,8);
VAR

a,x,y,b,valore,x1,y1,tempo,esatte,errate:integer;
nx:real;
frase1,frase2:string;

procedure pausa; (* attesa che si prema enter *)
var ch:char;
begin
setcolor(white);
outtextxy(400,390,'premi enter ');
ch:=readkey;
setcolor(black);
outtextxy(400,390,'premi enter ');
end;

procedure grafica; (* attivazione comandi grafici *)
var sc,tp:integer;
stringa:string;
BEGIN
sc:=0;tp:=0;stringa:='C:\tp\bgi';
initgraph(sc,tp,stringa);
setbkcolor(black);
end;

procedure testo(x,y:integer;frase:string);
begin
setcolor(white);
outtextxy(x,y,frase);
end;


procedure cancellagrafo;
begin
cleardevice;
end;

procedure sosta1;
begin
delay(valore);
end;

procedure sosta2(tempo:integer);
begin
delay(tempo);
end;

procedure titolando; (* bicchiere con soluzione da titolare *)
begin
moveto(100,200);
rectangle(100,200,200,370);
moveto(100,200);setcolor(black);lineto(200,200);setcolor(white);
bar(105,290,195,365);
testo(220,350,'bicchiere graduato con 40 cc. = V2 noto');
testo(220,360,'di soluzione da titolare o nota N2');
testo(220,370,'e un indicatore di pH ');
sosta2(tempo);
end;


procedure buretta;
begin
moveto(140,200);lineto(140,170);lineto(120,170);lineto(120,10);
lineto(180,10);lineto(180,170);lineto(160,170);lineto(160,200);
testo(220,20,'buretta graduata con 40 cc.');
testo(220,30,'di soluzione TITOLANTE nota o ignota N1');sosta2(tempo);
end;

procedure buretta2;
begin
bar(125,12,178,168);pausa;
end;


procedure base2(riga,y,y1:integer);
begin
x:=125;x1:=105;
for a:=1 to riga do
begin
moveto(x,y);setcolor(black);lineto(178,y);
moveto(x1,y1);setcolor(white);lineto(195,y1);
sosta1;
y:=y+1;y1:=y1+1;
end;
end;

procedure pro1;
begin
testo(20,20,'aggiungendo volume noto di sostanza titolante di normalita nota');
testo(20,40,'a volume noto di soluzione titolanda di normalita ignota');
testo(20,60,'si calcola la grandezza ignota con la formula generale ');
testo(20,80,' N1 * V1 = N2 * V2 -------> N2 = N1 * V1 / V2 ');
testo(20,90,' V1 = N2 * V2 / N1 <------> N1 = N2 * V2 / V1 ');
pausa;
testo(20,140,'vengono proposti alcuni esempi con richiesta di indicare');
testo(20,150,'volume titolante necessario-V1 es.2 ---> 6 ');
testo(20,160,'la normalita ignota---------N2 es.7 ---> 22');
testo(20,170,'normalita titolante---------N1 es.23---> 25 ');pausa;
end;

procedure graduaa;
begin
setcolor(white);
y:=210;
for a:=1 to 8 do
begin
moveto(95,y);lineto(205,y);
y:=y+20;
end;
end;

procedure graduab;
begin
y:=10;;
for a:=1 to 5 do
begin
moveto(115,y);lineto(185,y);
y:=y+40;
end;
end;


procedure aggiunge;
begin
testo(220,60,'aggiungere 10 cc.di titolante');
testo(220,70,'premendo ENTER ');
end;

procedure aggiunge2;
begin
testo(220,60,'aggiungere cc.di titolante');
testo(220,70,'premendo ENTER ');
testo(220,80,'fino a viraggio indicatore');
end;


procedure indicatore3(y1:integer);
begin
setfillpattern(fondo,7);
bar(105,y1,195,365);
testo(220,260,'viraggio indicatore');
testo(220,270,'neutralizzazione completata');
end;

procedure analisi1(frase1:string);
begin
testo(220,120,frase1);
end;

procedure analisi2(frase2:string);
begin
testo(220,140,frase2);
end;


procedure ana7a(frase1:string);
begin
analisi1(frase1);
end;

procedure ana7b(frase2:string);
begin
analisi2(frase2);pausa;
end;

procedure attiva1(riga,y,y1:integer;frase1,frase2:string;cx:real);
begin
titolando;buretta;graduaa;graduab;aggiunge2;buretta2;
base2(riga,y,y1);
pausa;indicatore3(y1);
ana7a(frase1);
testo(230,200,'scrivi valore N2 con 3 decimali ?');
testo(230,210,'scrivi 0 se non sai ');
readln(cx);
if cx=nx then begin
testo(230,220,'esatto');esatte:=esatte+1;end
else begin testo(230,220,'errato');errate:=errate+1;end;
ana7b(frase2);;
end;

procedure attiva2(riga,y,y1:integer;frase1,frase2:string;cx:real);
begin
titolando;buretta;graduaa;graduab;aggiunge2;buretta2;
base2(riga,y,y1);
pausa;indicatore3(y1);
ana7a(frase1);
testo(230,200,'scrivi valore V1 ?');
testo(230,210,'scrivi 0 se non sai ');
readln(nx);
if cx=nx then begin
testo(230,220,'esatto');esatte:=esatte+1;end
else begin testo(230,220,'errato');errate:=errate+1;end;
ana7b(frase2);;
end;

procedure attiva3(riga,y,y1:integer;frase1,frase2:string;cx:real);
begin
titolando;buretta;graduaa;graduab;aggiunge2;buretta2;
base2(riga,y,y1);
pausa;indicatore3(y1);
ana7a(frase1);
testo(230,200,'scrivi valore N1 con 3 decimali o?');
testo(230,210,'scrivi 0 se non sai ');
readln(nx);
if cx=nx then begin
testo(230,220,'esatto');esatte:=esatte+1;end
else begin testo(230,220,'errato');errate:=errate+1;end;
ana7b(frase2);;
end;

procedure pro2;
begin
frase1:='dati noti : N1 = 1 N N2 = 0.250 V2=40cc ';
frase2:='soluzione: V1 = N2*V2/N1 = 10 cc ';
attiva2(38,12,270,frase1,frase2,10);
end;

procedure pro3;
begin
frase1:='dati noti : N1 = 1 N N2 = 0.5 N V2=40cc ';
frase2:='soluzione: V1 = N2*V2/N1 = 20 cc ';
attiva2(78,12,250,frase1,frase2,20);
end;

procedure pro4;
begin
frase1:='dati noti : N1 = 1 N N2 = 0.75 N V2=40cc ';
frase2:='soluzione: V1 = N2*V2/N1 = 30 cc ';
attiva2(118,12,230,frase1,frase2,30);
end;

procedure pro5;
begin
frase1:='dati noti : N1 = 1 N N2 = 1 N V2=40cc ';
frase2:='soluzione: V1 = N2*V2/N1 = 40 cc ';
attiva2(158,12,210,frase1,frase2,40);
end;

procedure pro6;
begin
frase1:='dati noti : N1 = 1 N N2 = 0.375 V2=40cc';
frase2:='soluzione: V1 = N2*V2/N1 = 15 cc ';
attiva2(58,12,260,frase1,frase2,15);
end;

procedure pro7;
begin
frase1:='dati noti : N1 = 1 N V1=10cc V2=40cc ';
frase2:='soluzione: N2 = N1*V1/V2 = 0.250 N ';
attiva1(38,12,270,frase1,frase2,0.250);
end;

procedure pro8;
begin
frase1:='dati noti : N1 = 1 N V1=20cc V2=40cc ';
frase2:='soluzione: N2 = N1*V1/V2 = 0.500 N ';
attiva1(78,12,250,frase1,frase2,0.500);
end;


procedure pro9;
begin
frase1:='dati noti : N1 = 1 N V1=30cc V2=40cc ';
frase2:='soluzione: N2 = N1*V1/V2 = 0.750 N ';
attiva1(118,12,230,frase1,frase2,0.750);
end;


procedure pro10;
begin
frase1:='dati noti : N1 = 1 N V1=40cc V2=40cc ';
frase2:='soluzione: N2 = N1*V1/V2 = 1 N ';
attiva1(158,12,210,frase1,frase2,1);
end;


procedure pro11;
begin
frase1:='dati noti : N1 = 1 N V1=15cc V2=40cc';
frase2:='soluzione: N2 = N1*V1/V2 = 0.375 ';
attiva1(58,12,260,frase1,frase2,0.375);
end;


procedure pro12;
begin
frase1:='dati noti : N1 = 1 N V1=25cc V2=40cc';
frase2:='soluzione: N2 = N1*V1/V2 = 0.625 ';
attiva1(98,12,240,frase1,frase2,0.625);
end;

procedure pro13;
begin
frase1:='dati noti : N1 = 1 N V1=35cc V2=40cc';
frase2:='soluzione: N2 = N1*V1/V2 = 0.875 ';
attiva1(138,12,220,frase1,frase2,0.875);
end;

procedure pro14;
begin
frase1:='dati noti : N1 = 1 N V1=5cc V2=40cc';
frase2:='soluzione: N2 = N1*V1/V2 = 0.125 ';
attiva1(20,12,280,frase1,frase2,0.125);
end;

procedure pro15;
begin
frase1:='dati noti : N1 = 0.5 N V1=10cc V2=40cc ';
frase2:='soluzione: N2 = N1*V1/V2 = 0.125 N ';
nx:=0.5*10/40;
attiva1(38,12,270,frase1,frase2,nx);
end;

procedure pro16;
begin
frase1:='dati noti : N1 = 0.2 N V1=20cc V2=40cc ';
frase2:='soluzione: N2 = N1*V1/V2 = 0.1005 N ';
nx:=0.2*20/40;
attiva1(78,12,250,frase1,frase2,nx);
end;

procedure pro17;
begin
frase1:='dati noti : N1 = 0.1 N V1=30cc V2=40cc ';
frase2:='soluzione: N2 = N1*V1/V2 = 0.075 N ';
nx:=0.1*30/40;
attiva1(118,12,230,frase1,frase2,nx);
end;

procedure pro18;
begin
frase1:='dati noti : N1 = 1 N V1=40cc V2=40cc ';
frase2:='soluzione: N2 = N1*V1/V2 = 1 N ';
attiva1(158,12,210,frase1,frase2,1);
end;

procedure pro19;
begin
frase1:='dati noti : N1 = 0.6 N V1=15cc V2=40cc';
frase2:='soluzione: N2 = N1*V1/V2 = 0.225 ';
nx:=0.6*15/40;
attiva1(58,12,260,frase1,frase2,nx);
end;

procedure pro20;
begin
frase1:='dati noti : N1 = 0.3 N V1=25cc V2=40cc';
frase2:='soluzione: N2 = N1*V1/V2 = 0.187 ';
nx:=0.3*25/40;
attiva1(98,12,240,frase1,frase2,nx);
end;

procedure pro21;
begin
frase1:='dati noti : N1 = 0.5 N V1=35cc V2=40cc';
frase2:='soluzione: N2 = N1*V1/V2 = 0.437 ';
nx:=0.5*35/40;
attiva1(138,12,220,frase1,frase2,nx);
end;

procedure pro22;
begin
frase1:='dati noti : N1 = 2 N V1=5cc V2=40cc';
frase2:='soluzione: N2 = N1*V1/V2 = 0.250 ';
nx:=2*5/40;
attiva1(20,12,280,frase1,frase2,nx);
end;

procedure pro23;
begin
frase1:='dati noti : V1 = 10 cc N2 = 0.250 V2=40cc ';
frase2:='soluzione: N1 = N2*V2/V1 = 1 N ';
attiva3(38,12,270,frase1,frase2,1);
end;

procedure pro24;
begin
frase1:='dati noti : V1 = 20 cc N2 = 0.5 N V2=40cc ';
frase2:='soluzione: N1 = N2*V2/V1 = 1 N ';
attiva3(78,12,250,frase1,frase2,1);
end;

procedure pro25;
begin
frase1:='dati noti : V1 = 30 cc N2 = 0.75 N V2=40cc ';
frase2:='soluzione: N1 = N2*V2/V1 = 1 N ';
attiva3(118,12,230,frase1,frase2,1);
end;


procedure fine; (* conferma uscita operazione *)
begin
testo(20,400,'fine operazione:confermare :premi enter');
readln;
end;


procedure scelta; (* procedura con scelta opzioni e uscita *)
var s,sn:string;opzione:integer;
begin
clrscr;cancellagrafo;
testo(20,20,'seleziona opzione per ');
testo(20,30,'1...descrizione esperimento di titolazione');
testo(20,40,'-------------------------------------------------------------');
testo(20,50,'2.3.4.5.6..................chiede di calcolare il volume V1');
testo(20,60,'7 8 9 10 11 12 13 14....chiede di calcolare la normalita N2');
testo(20,70,'15 16 17 18 19 20 21 22....chiede di calcolare la normalita N2');
testo(20,80,'23.24.25...................chiede di calcolare la normalita N1');
testo(20,90,'----------------------------------------------------------');
testo(20,100,'30...fine ');
testo(20,120,'scelta =');readln(opzione);
grafica;
case opzione of
1:pro1;
2:pro2;3:pro3;4:pro4;5:pro5;6:pro6;
7:pro7;8:pro8;9:pro9;10:pro10;
11:pro11;12:pro12;13:pro13;14:pro14;
15:pro15;16:pro16;17:pro17;18:pro18;19:pro19;20:pro20;21:pro21;22:pro22;
23:pro23;24:pro24;25:pro25;
30:fine;
end;

testo(20,390,'altra operazione?Esperimenti?:premi S...fine:premi N ');
readln(sn);
if ((sn='S') or (sn='s')) then scelta ;
end;

begin (* programma di lancio *)
clrscr;
grafica;
valore:=5;
tempo:=10;
esatte:=0;errate:=0;
scelta;
cancellagrafo;
closegraph;clrscr;

textmode(1);
writeln(' chiama insegnante per la valutazione ');
writeln('totale domande = ',esatte+errate);
writeln(' risposte esatte = ', esatte);
writeln(' risposte errate = ', errate);
writeln('premi ENTER ');
readln;
end.