Example from textbook"C++, how to program"