Spot the Signs. Do you have a good relationship with your manager? Is he or she relatively reasonable? Do you have regular one_on_ones where you talk about your career goals and growth? If so, it's likely that your boss will accept your resignation with grace, help develop a plan of action for your last two weeks, and maybe even attend your farewell happy hour.
It also starts the clock for your boss and your company, kicking off the transition plan of training, hiring, and otherwise covering your impending departure. The bad examples here are all too vague. With the last one, you're aligning yourself with company policy, which is good, but it still doesn't tell the reader how much notice that actually is. Be as specific as possible on the time you have between now and your last day.