I want to create a do while loop for a statement to keep on looping until a following number or string value is passed. this is the code that i was trying to put in.
#include "vending.h"
int main()
{
cout << "\n\n\n\n----------Welcome to the coolest vending machine!!!!!!!-----------\n\n";
cout << "Press 1 and enter to display the list of products in the vending machine.\n";
cout << "Press 2 and enter to check the price of each product.\n";
cout << "Press 3 and enter to check the quantity of the products.\n";
cout << "Press 4 and enter twice to exit out of the vending machine.\n";
cout << endl;
vendingM vmObject;
int x;
do{
cin >> x;
cout << endl;
switch(x)
{
case 1:
vmObject.displayList();
break;
case 2:
//do{
vmObject.priceChecker();
//}while(y != 0);
break;
case 3:
//do{
vmObject.quantityOfProducts();
//}while(q!=0);
}
}while( x!=4);
system("pause");
return 0;
};
help!!