Search


Software Design Using C++



Review of Loop Patterns



Answering the Question


Remember that we are trying to rewrite the test program so that the program now has the user interactively enter a list of items to buy. For each item to be purchased, the program should prompt the user to enter the unit price and the number of units of this item to buy. The program should output the cost for each type of item and, at the end, the total cost. If you need to review loop patterns first, go to the Programming Patterns section of these web pages.

Here are possible loop patterns that might be used in this problem. Click on the one that you think fits best.
Back to the main page for Software Design Using C++

Authors: Br. David Carlson and Br. Isidore Minerd
Last updated: August 27, 2009