Reference no: EM132177372
Vectors and Searching Purpose: To practice the use of a vector and the vector functions: Specifications: This program will allow the user to see a list of teams, add a team to the list, or search for a team using an ID.
1. Structure Definition First define struct TeamS with an integer field to hold an ID, and an array of strings with three elements to hold the names of the team members.
In the main function, declare an empty vector of TeamV and also the following arrays: const int ID [NUM_TEAMS] ={ 123, 321, 456, 789}; const string MEMBERS [NUM_TEAMS] [NUM_MEMBERS ] = { {"Mike", "Joe", "John"}, {"Christina", "Kevin", "Jim"}, {"Thomas", "Kim", "Emily"}, {"July", "Jason", "Jason"} };
2. Creating the vector- Call a function with the following prototype and pass in the empty vector and the arrays: void Initialize (vector & TeamV, const int id[], const string m[][NUM_MEMBERS], int arraySize); The function should place into the vector the elements of the arrays.
For example, the first element of the vector will have team id: 123 and members: Sarah, Joe, and John.
The second element of the vector will have team id: 321 and members: Chris, Kevin, and James, and so on. 3. The print function (10 points) Back in main, call a function with the following prototype to show that your vector has been populated with the team information: void printList (const vector & TeamV); The function simply prints out the content of the vector.