We have been given a file of chemical formulae specifically


We have been given a file of chemical formulae, specifically hydrocarbons that consist of only hydrogen and carbon atoms.

Each line of the file contains the name of the chemical followed by its molecular formula in the form C#H# where # is the number of carbon (C) and hydrogen (H) atoms. No name in the file contains blanks.

Because hydrocarbons with the same molecular formula can appear in many structural forms and each of the forms has a different name, the same molecular formula might appear more than once in the file with different names. (e.g.: Butane and 2-methylpropane both have the molecular formula C4H10.)

We would like to keep one entry for each unique molecular formula along with all the names for that formula and then display all these entries in order by ascending number of carbon atoms.

Please refer to the attachment for further details.

Attachment:- rec2h.docx

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: We have been given a file of chemical formulae specifically
Reference No:- TGS01248273

Now Priced at $20 (50% Discount)

Recommended (91%)

Rated (4.3/5)