Text this: Modeling a computational program with mass and energy balances