Some of the urban high schools have done that around here. A few of them have totally separate academies for the 9th graders, in different buildings. Two of them that have their 9th graders keep the boys and girls segregated, and the directions are if an upperclass boy even looked inside those grade 9 girls' classrooms, call security.
The most impressive thing is that when rules are strict, no exceptions, no favoritism, the kids, both young girls and older guys, accept them with grace and humor (I'm not being sarcastic)
The latter is quite possible and often done simply by combining 7-9th in middle school.
I would stand by the former being impossible though, as 17 and 18 year olds need to be attending the same classes.