turbo pascal v.1.1 per mac
program pH5; (* problemi su calcolo concentrazioni noto il pH o pOH *)
const pkw=14; kw=0.00000000000001;
var ph,poh,d,h,oh,ka,kb,pka,pkb,ca,cb:real; s:integer;
procedure fine; begin writeln('premi enter'); readln; end;
procedure notophf; begin writeln('calcolo concentrazione... H+ OH- '); writeln('valore pH ');readln(ph); d:=ln(10); h:=exp(-ph*d); oh:=kw/h; poh:=pkw-ph; writeln('pH =',ph:8:2); writeln('pOH =',poh:8:2); writeln('concentrazione idrogenionica =',h:8:14,'...',h); writeln('concentrazione ossidrilica =',oh:8:14,'...',oh); readln; end;
procedure notopohf; begin writeln('valore pOH ');readln(poh); d:=ln(10); ph:=pkw-poh; h:=exp(-ph*d); oh:=kw/h; ph:=pkw-poh; writeln('pH =',ph:8:2); writeln('pOH =',poh:8:2); writeln('concentrazione idrogenionica =',h:8:14,'...',h); writeln('concentrazione ossidrilica =',oh:8:14,'...',oh); readln; end;
procedure notophad; begin writeln('calcolo concentrazione... H+ OH- '); writeln('valore pH ');readln(ph); writeln('costante acido debole ');readln(ka); d:=ln(10); ca:=exp(-ph*d); h:=sqrt(ka*ca); oh:=kw/h; poh:=pkw-ph; writeln('pH =',ph:8:2); writeln('pOH =',poh:8:2); writeln('concentrazione idrogenionica =',h:8:14,'...',h); writeln('concentrazione ossidrilica =',oh:8:14,'...',oh); writeln('premi enter');readln; end;
procedure notopohad; begin writeln('calcolo concentrazione... H+ OH- '); writeln('valore pOH ');readln(poh); writeln('costante acido debole ');readln(ka); d:=ln(10); ph:=pkw-poh; ca:=exp(-ph*d); h:=sqrt(ka*ca); oh:=kw/h; writeln('pH =',ph:8:2); writeln('pOH =',poh:8:2); writeln('concentrazione idrogenionica =',h:8:14,'...',h); writeln('concentrazione ossidrilica =',oh:8:14,'...',oh); writeln('premi enter');readln; end;
procedure notophbd; begin writeln('calcolo concentrazione... H+ OH- '); writeln('valore pH ');readln(ph); writeln('costante base debole ');readln(kb); d:=ln(10); poh:=pkw-ph; cb:=exp(-poh*d); oh:=sqrt(kb*cb); h:=kw/oh; writeln('pH =',ph:8:2); writeln('pOH =',poh:8:2); writeln('concentrazione idrogenionica =',h:8:14,'...',h); writeln('concentrazione ossidrilica =',oh:8:14,'...',oh); writeln('premi enter');readln; end;
procedure notopohbd; begin writeln('calcolo concentrazione... H+ OH- '); writeln('valore pOH ');readln(poh); writeln('costante base debole ');readln(kb); d:=ln(10); ph:=pkw-poh; cb:=exp(-poh*d); oh:=sqrt(kb*cb); h:=kw/oh; writeln('pH =',ph:8:2); writeln('pOH =',poh:8:2); writeln('concentrazione idrogenionica =',h:8:14,'...',h); writeln('concentrazione ossidrilica =',oh:8:14,'...',oh); writeln('premi enter');readln; end;
procedure scelta; var ancora:integer; begin clearscreen; writeln('seleziona tipo problema :CALCOLO IDROGENIONI,OSSIDRILI'); writeln('essendo noti alcuni parametri sotto indicati '); writeln('1...pH acido forte o base forte'); writeln('2...pOH acido forte o base forte '); writeln('3...pH acido debole '); writeln('4...pOH acido debole'); writeln('5...pH base debole'); writeln('6...pOH base debole'); writeln('7...fine '); write('opzione=');readln(s); clearscreen; case s of 1:notophf; 2:notopohf; 3:notophad; 4:notopohad; 5:notophbd; 6:notopohbd; 7:fine; end; writeln('----------------------------'); writeln('altro problema:scrivi 1...fine:scrivi 2 ');readln(ancora); if ancora =1 then scelta else fine; end;
begin clearscreen; writeln('formule per calcolo H+,OH- conoscendo pH ,pOH '); writeln('---------------------------------------------------'); writeln('si deve inserire su richiesta:'); writeln('pH,pOH '); writeln('-----------------------------'); writeln('premi enter');readln; scelta; end.