Sorry, but that had to be done. A sub is such an incredibly complex conglomeration of components that no dozen areas of expertise could put one together. The actual construction is done by incredibly talented welders, millwrights, electricians, electronics technologists, painters and so on. Every subsystem on board is designed by specialists in a particular field. Nuclear engineers and thermodynamicists and steam engineers and bearing specialists design the power train; accoustic and electronic engineers design passive and active sonar systems; hydrodynamic specialists design propellors and manouevring thrusters; weapons technologists handle torpedoes, decoys, mines, deck guns, etc.; medical specialists design the sickbay; everything down to galley layouts and janitorial facilities are set up by people who know that particular area. The easiest answer to "who builds it" is a navy.
I think the question should hing on the type of sub in question. Yeah, the USS Parche needed every type of engineer imaginable; however, the glass bottom subs tourists ride in Wikiki probably were designed by only a few engineers. To answer the original question we need to know the scale of the question and not just assume the asker meant trafalgar class submarines.
Being in the business, I would say that the brunt of the engineering is done by EE's and ME's (85%). In a lot of cases it comes down to who is available to work the project. We need someone to work on designing a "X" and although you have never designed an "X" before, you have been picked to do the work. Granted there are people who have spent a lifetime working RF or sonar but in todays do more with less Navy, you get called on to do a variety of work, it's what makes the job interesting. I am speaking only on the design side of the house, test and evaluation, building the hull, etc. brings in the tradesmen, techs, etc.
If you are asking because you are interested in that kind of career, then I would say Mechanical or structural Engineering would be a good point of departure to enter the field. Structural if hull design is what you are after, or mechanical if the workings of the machinery (life support, propulsion, cooling, heating, etc.)
Artman is correct, structural/mechanical for hull and machinery design. I would look at learning AutoCAD, most if not all builders are doing the arrangements of equipment using modeling. The Virginia Class subs were designed using V/R techniques. You could expect to be designing anything from hull penetrators to machinery mounts to enclosures for equipment. If you are looking at an EE degree, there are many different avenues you could go. RF or antenna design, acoustics, DSP and computer control... the list goes on and on. I would caution that most of us have had our hands in more than one of these areas, so expect to cross over to mechanical even if you are an EE. I work in electromagnetic compatibility but in doing so have been involved in cabinet design, connector design, you get the drift.
We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling We Value Civility
• Positive and compassionate attitudes
• Patience while debating We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving