A340 history
To be fair on the 340, it was designed in the late eighties when 90/120 min ETOPS was in force, and the twins did not yet rule. AB well realized the superior economics of the twin, but also was aware of the need for a long range aircraft on routes beyond the maximum range of twins (at that time) and on some routes where even 180 min ETOPS requires a long diversion. Rather smartly they designed an airframe that could be fitted with 2 or 4 engines, the first became the 330, the latter the 340, then leaned back to see how the 2 vs. 4 battle ends. Twins clearly won, and now the 330 is their principal cash cow - they can easily afford some losses on late delivery 340s, as the two programmes are really one, and with development costs I presume long since recovered, they are making very comfortable margins on currently sold airframes. Parts and assembly are typically ~50% of the cost of a new aircraft, the rest is allocated R&D.