Question: How do I code a program that calculates the molecular weight and average weight of a compound depending on how many oxygens, carbons, nitrogens, sulfurs,
How do I code a program that calculates the molecular weight and average weight of a compound depending on how many oxygens, carbons, nitrogens, sulfurs, and hydrogens the user inputs?
-It needs three decimal precision
- The program should ask the user if they want to calculate the weights for another amino acid and exit when the user finally says "No" is some form.
- Use a do while loop to achieve this

Table 2: Molecular Weights Element Atomic Weight Oxygen 15.9994 Carbon 12.01 1 Nitrogen 14.00674 Sulfur 32.066 Hydrogen 1.00794 (unit is u, which is 'atomic mass unit')
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
