/* Problem chapter2_40 */
/* */
/* This program computes the average atomic weight of the atoms */
/* found in a particular amino acid given the number of atoms for */
/* each of the five elements found in amino acid. */
int no_oxy, no_carbon, no_nitro, no_hydro, no_sulfur, total_no;
double average_atomic_weight;
/* Enter the number of atoms for each of the five elements. */
cout << “Enter the number of oxygen atoms found “
<< ” in the amino acid. \n”;
cin >> no_oxy;
average_atomic_weight = ((no_oxy*OXYGEN) + (no_carbon*CARBON) +
(no_nitro*NITROGEN) + (no_sulfur*SULFUR) +
(no_hydro*HYDROGEN))/total_no;
/* Print the average atomic weight. */
cout << “The average weight of the atoms in this particular amino “
<< “acid is ” << average_atomic_weight << endl;