Any person violating any of the provisions of this part 5 is guilty of a misdemeanor and, upon conviction thereof, shall be punished by a fine of not less than twenty-five dollars nor more than three hundred dollars for each offense, or by imprisonment in the county jail for not less than ten days nor more than thirty days for each offense, or by both such fine and imprisonment.