In boot camp they basically prepare them to be fleet sailors, not naval infantry, a role served quite nicely by US Marines. After boot camp sailors go off to A school to learn the specialties they will pursue.
Some guys (sorry, showing my age again), er, folks learn to repair boilers, some folks learn to repair sophisticated electronic weapons systems. Some learn to launch planes off the deck of a pitching ship, some becomes Seals and get to kill bad people.
If you're going to have a need to use an assault rifle, don't worry, they teach you how to use it.