If you resign on 4th Jul, your last day will be 3rd Aug
If it is a Sat/Sun, you last day will be the last friday. But on Sat/Sun you are still employed under your company (which means you still have to obey the rules and regulations, e.g. can not working in another company; and still enjoy the benefits, e.g. medical claim.)