Can "You are an officer and a gentleman" be used to praise a good deed done by a person completely unrelated to armed forces?
I would like to praise a friend of mine for an act of kindness. Is it appropriate to use this phrase for civilian people?
I think OP is getting things confused with...
Or the more natural order to my ear...
It's probably safe to say it's usually said somewhat facetiously these days (the stereotypical usage is a drunk thanking someone for buying them another drink).
I think even if OP changes it from a scholar to an officer, outside the literal military context, most people would be put in mind of the above, so it probably wouldn't suit his intended contexts.
Eric Partidge's Dictionary of Slang and Unconventional English says that dating mostly from C16-C17 there were many variants on ...as I am a gentleman and scholar/officer/etc., used to mean Believe me!. But by later C20 they're all invariably used as "Jocular thanks".