Whenever any person is indicted or presented in a court of record for the alleged commission of any felony, the elements of which include the commission of a misdemeanor, and the defendant pleads not guilty and is tried by a jury, in such case, upon demand of the defendant timely made, the trial jury shall as a part of its verdict, should it find the defendant not guilty of the felony but guilty of a misdemeanor included within the felony, assess the punishment for the misdemeanor offense both as to fine and imprisonment within the limits now or later prescribed by law.