Final answer:
The correct sentence is option (D): Both mechanics and machinists work with machines; the former fix machines while the latter build them.
Step-by-step explanation:
The correct sentence is option (D): Both mechanics and machinists work with machines; the former fix machines while the latter build them. This sentence is punctuated correctly because it uses a semicolon to separate two independent clauses and a comma before the coordinating conjunction 'while' to join the two contrasting clauses. The use of the pronouns 'the former' and 'the latter' helps to clearly refer to mechanics and machinists respectively.
Learn more about Punctuation in English sentences