The problem is to print an Invoice. Printing with cout means Invoice would use the ostream class. However, for more flexibility about where the printing takes place, make each class(es) responsible for providing a formatted string that could be printed to the terminal, to a file, etc.