Butane has six primary and four secondary hydrogen atoms. A halogen can replace either kind. You will find the share of 2-halobutane in the product.
The idea. The weight of each kind of hydrogen is its number times its rate. The share of a product is its weight divided by the total weight.
Your tasks.
weight_primary to the weight of the primary hydrogen atoms.weight_secondary to the weight of the secondary hydrogen atoms.percent_2 to the percentage of 2-halobutane in the product.ratio to how many times more 2-halobutane is made than 1-halobutane.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…