Question: Molecular Weight Calculator (basic programming) create a program to calculate the molecular weight of a molecule with 2 elements in it (for example, H2O or

Molecular Weight Calculator (basic programming) create a program to calculate the molecular weight of a molecule with 2 elements in it (for example, H2O or CH4) The user will provide the atomic element symbols, atomic weights, and how many atoms of each element are in the molecule. Molecular Weight Calculator (basic programming) create a program to calculate the molecular

Next your program asks for three pieces of information about the first element in the molecule: 1. its chemical symbol (a single "word" like H, O, C, Na, or Cl); 2. its atomic weight (a number like 1.01, 16.00, 12.01,22.99); and 3. how many atoms of that kind are in the molecule (a counting number). Next it gets the same information for the second element. Your program then pauses again. Finally, your program prints out the result of its calculation. The result includes the formula for the molecule as well as the molecular weight. Note, the output may include some is where the formula would not. For example, the formula NaCl will be output as NalCll. That is fine. Also note that there is no (easy) way to get the numbers to print as subscripts, so do not bother to try. Just accept that the formula for water is going to look like H201. To calculate the weight of the molecule use the formula weight* count + weight x count where weight is the atomic weight of the first element, count is how many atoms of the first element are in the molecule, and similarly for weight and count- Next your program asks for three pieces of information about the first element in the molecule: 1. its chemical symbol (a single "word" like H, O, C, Na, or Cl); 2. its atomic weight (a number like 1.01, 16.00, 12.01,22.99); and 3. how many atoms of that kind are in the molecule (a counting number). Next it gets the same information for the second element. Your program then pauses again. Finally, your program prints out the result of its calculation. The result includes the formula for the molecule as well as the molecular weight. Note, the output may include some is where the formula would not. For example, the formula NaCl will be output as NalCll. That is fine. Also note that there is no (easy) way to get the numbers to print as subscripts, so do not bother to try. Just accept that the formula for water is going to look like H201. To calculate the weight of the molecule use the formula weight* count + weight x count where weight is the atomic weight of the first element, count is how many atoms of the first element are in the molecule, and similarly for weight and count

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!