I have a program due tonight and am having numerous problems. Here is one function that is not working right:
Josh StevanusCode:void accept_item_code (char& upc)
{
bool valid = false;
cout << endl << "--------------------" << endl;
cout << "Enter product code: ";
cin >> upc;
upc = toupper(upc);
cout << upc;
cout << endl;
while (!valid)
{
if (upc == 'A' || upc == 'B' || upc == 'C' || upc == 'D' || upc == 'E')
{
valid = true;
}
else if (upc == 'F' upc == 'G' || upc == 'H' || upc == 'I' || upc == 'X')
{
valid = true;
}
else
{
cout << "!!! Invalid product code" << endl << endl
<< "Enter product code: ";
cin >> upc;
upc = toupper(upc);
cout << endl;
}
}
return;
}
[email protected]