example_4.cpp   Add input checking, fix brackets in if/else if section