Computing: Free Pascal Programming

Programming Home   Home   Contact

Balancing chemical equations (Stoichiometry).


Description: Chemistry trainer application: Generation of stoichiometry exercises, displaying chemical equations that the user must try to correctly balance. The chemical reactions are taken from a text file, actally containing 180 equation samples. For each of the reactants and products, the user has to enter the correct coefficient. Correct/false answers and success percentage are updated after each user answer

Programming notes: The equations contained in the sample file are not balanced. The application does this by itself. The routines used are the same as those used by my chemeq command line program. Have a look at the description of that program for information about how the balancing is implemented.

Improvements: An algorithm other than my brute force approach to balance the equations.

Free Pascal features: Recursion. String extraction. Complex Pascal data structures; reading text files (classical Pascal). Usage of subscripts in Free Pascal.

Screenshot:

Balancing chemical equations exercise