Hello,
I'm working on an assignment for class, in which:
1) I need to display a menu for fruit selection.
2) After selection is made, program asks for quantity (double).
3) Program should enter selection in class array (this seems fine).
Where I'm having the problem is in the do while loop that produces the menu. The condition is that should break the loop is when the user enters a selection of 11.
Currently, when "11" selected, the program locks up. The program should move to a cout statement, and run a function calculating total. I know it's a simple logic problem, and I'm just not seeing it.
Any help would be much appreciated. Thanks!
do
{
showMenu(nameArray, priceArray);
cout << "Please enter a selection: \n";
cin >> choice;
while (choice > 11 || choice <= 0)
{
cout << "Invalid selction, please re-enter:\n";
cin >> choice;
}
cout << "How many pounds of " << nameArray[choice-1] << " would you like?\n";
cin >> pounds;
shoppingList[count].setItem(nameArray[choice - 1], priceArray[choice-1], pounds);
count++;
} while (choice != 11);