You will write four functions that name esters and find their masses. One names an unbranched carboxylic acid. One names an ester from the carbon atoms of its acid and alcohol. One finds the relative formula mass of the ester. One counts all the different esters that can be made from acids and alcohols with up to four carbon atoms.
The idea. The stems are meth, eth, prop and but. The acid is the stem plus "anoic acid". The first word of an ester is the alkyl name of the alcohol, methyl, ethyl, propyl or butyl. The second word is the stem plus "anoate". The ester with carbon atoms is , so .
Your tasks.
acid_name(c).ester_name(a, b), for an acid with a carbon atoms and an alcohol with b carbon atoms.ester_mr(a, b).number_of_esters(), which counts the different names when a and b run from 1 to 4.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…