Nothing in §40-20-104 shall prevent any person indicted or presented in a court of record for the alleged commission of any misdemeanor as set out in that section from pleading guilty and submitting the case to the trial judge for assessment of punishment; nor shall anything in §40-20-104 prevent a person, upon a plea of not guilty, from waiving the right to a trial by jury and submitting the case to the trial judge for decision both as to guilt and punishment.