It works but then it prevents me from adding anything else to the array... the entire thing is in a loop
Code:
do
{
x++;
cout << "Enter the Name of Item " << x << ": ";
cin.getline(itemname[x],'\n');
cout << "Enter the Price of Item " << x << ": $";
cin >> itemprice[x];
cout << endl;
cout << "Is the Item Taxable (y/n) ";
cin >> taxyn[1][x];
cout << endl;
cout << endl;
stotal = stotal + itemprice[x];
if (taxyn[1][x] != 'n')
{
cout << "%";
gst = gst + (stotal * 0.1);
}
if (taxyn[1][x] = 'n')
{
cout << "";
gst = gst + (stotal * 0.0);
}
cout << itemname[x] << "\t\t$" << itemprice[x] << endl << endl;
cout << "Do you wish to add another Item? (y/n) ";
cin >> yn;
cout << endl;
if (x == 100)
{
cout << "Cannot Add any more Items!" << endl;
yn = 'n';
}
cout << endl;
system("PAUSE");
//clrscr();
} while (yn == 'y' || yn == 'Y');
It only lets me add one thing to itemname the first time the loop executes but after that, it just skips that step all together.