With few formal schools in the United States until after the Civil War, cadets would be accepted as young as 14 years of age. After the war, there were still few schools that taught beyond what we would now consider a middle school or junior high school level. There were higher level schools, generally called "Prep Schools" which prepared young men for college. But they were, for the most part, private schools and one had to be fairly wealthy to enroll the children. So it IS possible that, in the movie, he is 16 or 17. I believe that, during the Civil War, the enlistment age was set at 18 years. I'll have to look it up. Many of the young lads who fought were, of course, much younger, particularly in the Confederate Army.
Shakey
PS: Sometimes, on Facebook and other types of social media they will post a grade school exam. They are pretty hard sometimes, but my point is back then kids were taught things that they don't teach until the 9th grade or later now.