Problem
Problem
struct ITEM
{
string itemName;
string brand;
string type;
double price;
};
int main ()
{
int a = 0;
ITEM item[100];
bool condition = true;
cout << "Enter brand of the item :" << endl << endl;
cin >> item[i].brand;
int quantities = 0;
cout << "How many quantites :" << endl;
cin >> quantities;
item[i].price *= quantities;
a++;
}
while (condition)
{
char options;
cout << "Enter A for add item" << endl;
cout << "Enter D for remove item" << endl;
cout << "Enter F for finalize items" << endl;
cout << "Enter C for clear items" << endl;
cout << "Enter E for exit" << endl;
cin >> options;
int quantities = 0;
cout << "How many quantites :" << endl;
cin >> quantities;
item[a++].price *= quantities;
}
if (toupper(options) == 'D')
{
a--;
}
if (toupper(options) == 'F')
{
for (int i = 0; i < a; i++)
{
cout << "name of the item :" << item[i].itemName << endl;
cout << "name of the brand :" << item[i].brand << endl;
cout << "type of the item :" << item[i].type << endl;
cout << "price of the item :" << item[i].price << endl;
}
}
if (toupper(options) == 'C')
{
a = 0;
}
if (toupper(options) == 'E')
{
return 0;
}
}
}