Problem 2 --------- Write a class called person with a data field for first name, a data field for last name, and a data field indicating if the person is married or not. Write a member function called get_married which takes another person as input. The function should give this other person the same last name as the person used to call the function, and change the marital status of both persons. As usual the class should contain the function prototype. Answer 2 -------- class person { private: char fname[20]; char lname[20]; bool married; private: void get_married(person p_other); }; void person::get_married(person p_other) { strcpy(p_other.lname,lname); p_other.married = true; married = true; } Problem 3 --------- Write a function called same_nums which takes two input streams as input. The function assumes that those input streams are each already associated to a file of integers. The function should return true if the files are the same (meaning that they contain the same integers in the same order). Otherwise, return false. Answer 3 -------- bool same_nums(istream &in1, istream &in2) { int num1.num2; in1 >> num1; in2 >> num2; while(!in1.eof() && !in2.eof()) { if (num1 != num2) return false; in1 >> num1; in2 >> num2; } if (in1.eof() && in2.eof()) return true; else return false; } Problem 4 --------- Write a function called c_follows_b that takes a string as input and returns the number of times that b is immediately followed by c in the string. Example ------- Suppose the string is: abcbabbcabcbc Then the function will return 4. Answer 4 -------- int c_follows_b(char s[]) { int count = 0; int i; for (i=1; s[i] != '\0'; i++) if (s[i-1] == 'b' && s[i] == 'c') count++; return count; }