Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

in mal ae) at value Part II: (80 pts.) 0,20 +5, sh This program will use the STL

ID: 3834054 • Letter: I

Question

in mal ae) at value Part II: (80 pts.) 0,20 +5, sh This program will use the STL vector game of and In this game there is farmer class to play the and grain to the shore. The on the south bank of a river who needs to transport a fox, chicken, with boat travel alone. If the fox is left chicken, the is only large enou for one item or the can chicken will eat the gh grain, the If the chicken is left with the grain. The game is won if the farmer and all three items end up on the north bank- Code must use vector objects to store the south and north bank contents. Vector method push back to adds an vector and erase removes a found item from an iterator position. A partial program item to the generic You use foxgame.cpp is available on First Class illustrating use of vectors and al the generic find function to locate an item in the vector. The only valid data entries are strings armer is on the south bank "fox", "chicken' grain" or "none". fex chicken srail h bank contains Use an error-checking loop to ensure h bank contains chicken. Erain, none) Erape enter the to transport Cfox, not a valid that correct data is entered. enter the item to transport (foo, chicken. Erain, none) donut enter is not a chicken, grain, none) fox the item to transport (fox, s any key to continue When the user has entered an item, be cAusenicaronDesudopcos220Assignments s sure to check that it exists on the armer is on the north bank current bank before attempting to for grain transport it. Use an error message chicken, srain, none) f nter the item to transport similar to the one below does not exist on the north bank for grain nter the item to transport (fox, chscken, Pain, none) none armer is on the south bank h bank contains E fox srat nter the item to transport (fox, chicken, Brain armer is on the north bank for grain bank contains chicken srain, none) the it" to transport (fox, chicken, Screen shot to submit: is on the south bank fox rain chicken h bank contains Turn in a screen shot of a winning h bank contains chicken, Brain, nter the item to transport (fox, solution. You do not need to show any is over error messages. any key to continue #include kiostream ll include vector class #include

Explanation / Answer

#include #include #include using namespace std; int main () { vector v; v.push_back (50); v.push_back (2991); v.push_back (23); v.push_back (9999); vector ::iterator i = v.begin (); while (i != v.end ()){ cout