#include #include using namespace std; struct Survey { string Lname; string Fname; char PorC; }; void printSurvey(struct Survey survey); void printSurveys(struct Survey surveys[]); int main(void) { /* declare an int named a here */ /* declare a string named b here */ /* declare a Survey names S here */ int aaaSize = 50; int bbbSize = 30; int SSSSize = 10; /* declare an integer array named aa with a size of 50 here */ /* declare a string array named bb with a size of 30 here */ /* declare a Survey array named SS with a size of 10 here */ /* declare an integer array named aaa with size aaaSize, using the "new" keyword here */ /* declare an string array named bbb with size bbbSize, using the "new" keyword here */ /* declare an integer array named SSS with size SSSSize, using the "new" keyword here */ a = 25; b = 32; S.Lname = "Brown"; S.Fname = "Martin"; S.PorC = 'C'; for(int i = 0; i < 50; i++) { aa[i] = i; aaa[i] = i * 2; } for(int i = 0; i < 30; i++) { bb[i] = "bb String "; bbb[i] = "bbb String "; } for(int i = 0; i < 10; i++) { SS[i].Lname = "Foreman"; SS[i].Fname = "George"; SSS[i].Lname = "Wrigley"; SSS[i].Fname = "Pete"; if(i % 2 == 0) { SS[i].PorC = 'P'; SSS[i].PorC = 'C'; } else { SS[i].PorC = 'C'; SSS[i].PorC = 'P'; } } /* this takes the 2nd element of aa and copies it to a this works because aa[2] is a single integer, and so is a you DON'T have to do anything for this line */ a = aa[2]; /* this takes the 4th element of aaa and copies it to the 3rd element of aa. You DON'T have to do anything here */ aa[3] = aaa[4]; cout << "S = " << S.Lname << " " << S.Fname << " " << S.PorC << endl; cout << "S.Lname is " << S.Lname << endl; cout << "S.Fname is " << S.Fname << endl; cout << "S.PorC is " << S.PorC << endl; cout << "SS[5] = " << SS[5].Lname << " " << SS[5].Fname << " " << SS[5].PorC << endl; /* Here, you need to use the SS variable to change Survey S to be the same as the 5th element in SS, i.e. the existing Survey S should be equal to SS[5] */ cout << "Printing SS ... " << endl; printSurveys(SS); cout << "Printing SSS ... " << endl; printSurveys(SSS); /* copy the 7th element of SSS to the 2nd element of SS here*/ cout << "Printing SS ... " << endl; printSurveys(SS); return 0; } void printSurvey(struct Survey survey) { cout << survey.Lname << " " << survey.Fname << " " << survey.PorC << endl; } void printSurveys(struct Survey surveys[]) { for(int i = 0; i < 10; i++) { printSurvey(surveys[i]); } cout << " \n ... done \n\n"; }