Molar mass from a chemical formula — a TI-89 Titanium program
MOLAR89 is a TI-89 BASIC program for the TI-89 Titanium. Type a formula as text — C6H12O6, NaCl, Ca(OH)2 — and the program reads the element symbols, counts and one level of parentheses from the string and adds up the molar mass (28 common elements, IUPAC values).
What it asks for and what it shows
It asks for 1 value at its prompts. In the example below it shows MOLAR MASS.
Example run
One of its oracle test cases: “C6H12O6”. The inputs are typed in order, and the results are the values the case expects on the screen.
| Step | Value |
|---|---|
| You enter | |
| Input 1 | C6H12O6 |
| The screen shows | |
MOLAR MASS= | 180.156 |
How it's checked
7 test cases, each checked against an independent method. Replayed key by key on a virtual TI-89 Titanium, they make 21 checks.
How E-Code checks every program
Run it or put it on your calculator
- Open the library in the TI-89 Titanium calculator and pick “Molar mass from a chemical formula” (MOLAR89).
- Put it on your own calculator with a computer and a USB cable, or type it in by hand.
Related programs
- Limiting reagent for any number of reactants
- Titration curve: pH for a list of volumes
- Ideal gas PV=nRT: leave one blank
All TI-89 Titanium chemistry programs · All TI-89 Titanium programs