Most ships also have single cabins as well as single rates for double staterooms. In many cases, a cruise line will even find you an appropriate roommate to share a double if you ask them. Pack like you would for any resort. Generally, cruise vacations are casual by day, whether you're on the ship or ashore. In the evening, ships vary as to dress.
Attire is dictated by occasion.
For the Captain's Gala, for example, you'll want to wear something more formal, such as a dark suit, or cocktail dress, perhaps even a dinner jacket or gown. This is a matter of personal taste. But don't go out and buy one for the trip. Even on the most formal of ships, a dark suit and tie are just fine. Formal night at dinner might require jacket and tie, but other than that you can be as relaxed as you would be on land.