Here is a program that I made in Chemistry Class Last year. I realise that it is inefficiently programmed in come parts. Consequently, I would appreciate criticism.

```
PROGRAM:ACIDBASE
ClrHome
Disp "Calculates pH,
Disp "pOH, H+, and OH-
Disp " from any of
Disp "above values.
Disp "
Pause
ClrHome
Disp "Known?
Disp " pH
Disp " pOH
Disp " H+
Disp " OH-
1->W:0->F
Output(2,1,">
While W
0->K
While K=0
getKey->K
End
Output(F+2,1,"
If K=25 and F--=--0
F-1->F
If K=34 and F--=--3
F+1->F
If K=105
0->W
Output(F+2,1,">
For(P,0,1
For(Q,1,16
Output(P+7,Q,"
End
End
End
ClrHome
If F=0
"pH"->Str0
If F=1
"pOH"->Str0
If F=2
"H+"->Str0
If F=3
"OH-"->Str0
"Input "+Str0->Str1
Disp Str1
Input ">",I
If F=0
Then
If I<0 or I>14
Then
Disp "Error: Domain
Disp "0<=pH<=14"
Stop
End
I->A
14-A->B
10^(-A)->C
10^(-B)->D
End
If F=1
Then
If I<0 or I>14
Then
Disp "Error: Domain
Disp "0<=pOH<=14"
Stop
End
I->B
14-B->A
10^(-A)->C
10^(-B)->D
End
If F=2
Then I->C
-log(C)->A
14-A->B
10^(-B)->D
End
If F=3
Then
I->D
-log(D)->B
14-B->A
10^(-A)->C
End
ClrHome
Normal
Disp A
Disp B
Sci
Fix 6
Disp C
Disp D
Float
Normal
If A<7
Disp " Acid
If A>=7 and A<8
Disp " Neutral
If A>=8
Disp " Base
Output(1,1,"pH
Output(2,1,"pOH
Output(3,1,"H+
Output(4,1,"OH-
Output(5,1,"State
Stop
ClrHome
```