Shorts/flipflops are not allowed in the dining room at dinner. Breakfast and lunch are more casual. Dinner is either nice casual or formal for one or 2 nights depending on the lengthof the cruise. Nice casual means good quality, clean slacks or jeans, capris with a nice top, or sundress. Formal on Carnival isn't quite what formal means on high end cruises. You can dress up a nice dress or pantsuit with jewelry or accesories and be fine.
Have fun and ask more questions if you need to!