Software Design Using C++Review of Loop PatternsAnswering the QuestionRemember 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. You selected the "Repeat until the user says yes I want to quit" loop plan, shown in outline below. This is not workable since the problem description said nothing about asking the user whether or not to process another purchase. In other words, there is no yes/no question about whether to continue or quit the program. Go back and try again.
You can go back to the overall review listing: Review of Introductory Topics. Back to the main page for Software Design Using C++ |