Chapter 3: Problem 3
Write a program that computes the molecular weight of a carbohydrate (in grams per mole) based on the number of hydrogen, carbon, and oxygen atoms in the molecule. The program should prompt the user to enter the number of hydrogen atoms, the number of carbon atoms, and the number of oxygen atoms. The program then prints the total combined molecular weight of all the atoms based on these individual atom weights: Atom Weight \\[ \begin{array}{cc} & \text { (grams / mole) } \\ \hline \mathrm{H} & 1.00794 \\ \mathrm{C} & 12.0107 \\ \mathrm{O} & 15.9994 \end{array} \\] For example, the molecular weight of water \(\left(H_{2} O\right)\) is: \(2(1.00794)+\) \\[ 15.9994=18.01528. \\]
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.