I am trying to continue this loop until the person enters 0 then it will end up printing out the receipt. But it only lets me enter up to two two items then goes to press any key to continue. Why is it only letting me do two items before it quits? There is more cpp files and an h file but I am not including those here, I'm just stuck on this loop. What am I doing wrong? thanks for the help
Bryan
Code:#include <iostream>
#include <fstream>
#include <cctype>
#include <string>
//#include "grocery.h"
using namespace std;
int ProdNum;
string ProdName;
float ProdPrice;
char Taxable;
int Quantity;
const int tax_rate=.075;
int main()
{
ifstream OpenFile("inventory.txt");
char ch;
while(!OpenFile.eof())
{
OpenFile.get(ch);
cout << ch;
}
cout << endl << endl;
cout << "Thanks for shopping at OUR Market." << endl << endl;
{
int customer = 1;
cout << "Enter purchases for customer " << customer++ << endl;
cout << "Enter product code 0 to end purchases." << endl << endl;
}
cin >> ProdNum;
if (ProdNum!=0) {
cin >> ProdNum;
}
else {
cout<<"Thanks for shopping, your receipt is printed below" << endl << endl;
}
//Calculations
/*cout << "Is there another customer? (Y/N) ";
cin >> customer;
while (customer == "Y");
if (customer == "N")
cout << "Thanks for shopping at OUR Market." << endl;
*/
return 0;
}