Would you like to have the ability to do stoichiometry on your calculator?
Yes
 50%  [ 1 ]
No
 50%  [ 1 ]
Total Votes : 2

I have been working on a stoichiometry program. If anyone has any ideas or suggestions, please put them here. So far, I have almost completed it, but the conversion from moles to mass at the end is giving me a little bit of trouble. The code is basic enough, but the totals at the end do not come out to what they should be.
Here's the code:

Code:
Menu("CONVERT TO MASS?","YES",K,"NO",2A
Lbl K
ClrHome
Disp Str2
Disp "INPUT MOLAR MASS OF
Disp "REACTANT USED IN
Disp "CALCULATION
Input ":",E
ClrHome
Disp Str3
Disp "INPUT MOLAR MASS OF
Disp "PRODUCT USED IN
Disp "CALCULATION
Input ":",F
A*E->A
D*F->D
Fix 1
ClrHome
Output(1,1,A
Output(1,7,"GRAMS
Output(1,13,Str2
Output(2,1,D
Output(2,7,"GRAMS
Output(2,13,Str3
Pause
ClrHome

Will someone please help?
well molar mass is of course in grams/mol, so all you have to do to convert from moles to mass, since you have the molar mass(it's been inputted into the E and F variables as I can see) is multiply E or F by the number of moles to give you the mass in grams... not sure what there was before this piece of coding, but i'm assuming A and D are the numbers of moles? If that's the case, maybe you've switched them by accident? like D could be the number of moles for the products and E for the reactants?
That is possible.. I will check that. Thanks for the help!

I found my problem. It's the fact that I forgot about the elements and compounds that have subscripts.

Problem solved!
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement