cashRegister counter;
dispenserType candy(500, 50);
dispenserType chips(100, 65);
dispenserType gum(75, 45);
dispenserType cookies(100, 85);
int choice;
while (choice != 9)
{
switch (choice)
{
case 1:
sellProduct(candy, counter);
break;
case 2:
sellProduct(chips, counter);
break;
case 3:
sellProduct(gum, counter);
break;
case 4:
sellProduct(cookies, counter);
break;
default:
cout << "Invalid selection." << endl;
}//end switch
Last edited on