Are you asking if it is possible for someone who is dismissed for an honor code violation to be retained on active duty after not being allowed to graduate? If that is your question, yes, a student who is dismissed after the first day of school of their Junior year will owe an active duty service commitment. The amount of time of that service commitment will vary depending on how far past the 1st day of classes the separation occurred.
The individual would be sent to active duty as an enlisted member. The individual would depart the service academy and retain any course credits earned for completed courses. A second semester senior would likely already have enough completed credits to earn a 4-year degree from any civilian college - understanding that you would have to complete something from the new college to earn their degree. With the completed college degree, there would be multiple possible paths to earning an officer commission - even with a stain on their record. Guard and Reserve are also likely options for the separated cadet.
Others may have the specifics on your starting rank, and path to officer. I was an instructor at USAFA and a senior on the team I was coaching came to me the day before Spring Break and said he had just been busted for an honor code violation. He was dismissed in April of his senior year, but went on to become an officer through other means.