I'm tired of trying to code this..
I keep on putting the wrong things.. multiply by wrong thing, or divide the wrong thing.. etc.
So much easier with real life numbers -__-
So what I'm trying to do, is create a solver for the type of problems on the link below.
Examples are: Problem 1, 2, and 3.
http://www.chemteam.info/Mole/CombustionAnalysis.html
The difference with the ones already out there, is that I want to show the work.
Adding on, my work looks like CRAP because I kept getting things wrong and adding more "->" and more "->" to see if I could get something to work. Additionally, it can be reduced a lot.
Anyways, here's the code so far:
Code:
Furthermore, here are some things that can be replaced:
mass of H->1.01
mass of O->16
mass of C->12.01
I keep on putting the wrong things.. multiply by wrong thing, or divide the wrong thing.. etc.
So much easier with real life numbers -__-
So what I'm trying to do, is create a solver for the type of problems on the link below.
Examples are: Problem 1, 2, and 3.
http://www.chemteam.info/Mole/CombustionAnalysis.html
The difference with the ones already out there, is that I want to show the work.
Adding on, my work looks like CRAP because I kept getting things wrong and adding more "->" and more "->" to see if I could get something to work. Additionally, it can be reduced a lot.
Anyways, here's the code so far:
Code:
Lbl 9
ClrHome
ClrDraw
Input "g OF SAMPLE GIVEN ",G
Input "g CO2 GIVEN ",C
Input "g H2O GIVEN ",H
Input "g MASS OF CARBON",M
Input "g MASS OXYGEN",O
Input "g MASS OF HYDROGEN",U
(O)(2)+(M)->P
C(M/P)->Z
H*2->E
U*2->T
H+O->F
U*2->R
U+O*2->Q
F*((U*2)/(Q)->K
ClrHome
ClrDraw
Text(0,0,"CARBON. O*",2,"=",P
Text(6,0,"",C,"(",M,"/",P,"=",Z
Text(12,0,"HYDRGN. H*",2,"=",E
Text(24,0,"",H,"*(",R,")/(",H,"+ O",2,"=",K
Pause
ClrHome
ClrDraw
Text
Furthermore, here are some things that can be replaced:
mass of H->1.01
mass of O->16
mass of C->12.01