I\'ve just started learning C++ using C++ Primer Plus but I\'m having trouble with one of the examples. Like the book instructed I included cin.get() at the end
This line leaves a trailing newline token in the input stream, which then gets consumed by the next cin.get(). Just do a simple cin.ignore() directly before that: