// Practice // // I have defined the structure jediEquipment for you. // You are tasked with creating an array of jediEquipment // structures in main, and then writing a loop that will allow // the user to enter an item into the equipment list. #include using namespace std; struct jediEquipment{ string name; double price; string merchants [100]; int merchantsCount; }; int main() { const int SIZE = 3; // ADD - declare an array of jediEquipment named "inventory" (use SIZE) // allow's a user to enter 3 inventory items into the array of jediEquipment. // I use getline so we can enter strings with spaces. for(int i=0; i> inventory[i].price; cout << "Enter the merchants who carries the product : " << endl; char choice = 'y'; inventory[i].merchantsCount = 0; while (choice != 'n' && choice != 'N') { cin.ignore(100,'\n'); getline(cin, inventory[i].merchants[inventory[i].merchantsCount]); inventory[i].merchantsCount++; cout << "Enter another merchant?(y or n) : "; cin >> choice; } cout << endl; } cout << endl << "---INVENTORY---" << endl; // Write a FOR loop that prints the inventory to the screen // (name, price, and a list of merchants). // Note that you will need a nested loop to print out the list // of vendors and that merchantsCount stores the number of merchants // the user entered. // ADD CODE HERE return 0; }