Problem 1 (30 points): A. Write a function called biggest_index which takes an array of integers and the size of the array as parameters. The function should return the index position of the biggest integer in the array. int biggest_index(int A[], int size) { int max_index = 0; int i; for (i=1; i A[max_index]) max_index = i; return max_index; } B. Write a program which asks how many cookies the user has eaten each day for a year (365 days). The program then prints how many cookies the user ate on the day following the day the most cookies were eaten. If the most cookies were eaten on the last day of the year, then just print a message saying that the most cookies were eaten on the last day of the year. [Use the function from part A.] int main() { int num_cookies[365] int max_index; int i; for (i=0; i<365; i++) { cout << "How many cookies did you eat on day " << i+1 << "? "; cin num_cookies[i]; } max_index = biggest_index(num_cookies,365); if (biggest_index < 364) cout << "You ate " << num_cookies[max_index+1] << " on the day after your biggest day\n"; else cout << "You ate the most cookies on the last day\n"; } ------------------------------------------------------------------------------ Problem 2 (40 points): A. Write a function called at_least_one which takes two characters and a string as parameters. The function should return true if at least one of the two characters appears in the string, otherwise false. For example, if the two characters are 'n' and 't', then the function will return true for the string "angel", and also for the string "sweet" and the string "innocent". bool at_least_one(char c, char d, char word[]) { int i; for (i=0; word[i]!='\0'; i++) if(word[i] == c || word[i] == 'd') return true; return false; } B. Write a function called ef_file which takes an input file stream as parameter. Assume that the input file stream is already associated with a file that has been opened. (Assume the file contains only words made up of lower case letters with no numbers or punctuation.) The function should return true if every word in the file contains an 'e' or an 'f', otherwise false. [Use the function from part A.] For example, the function will return true for the following file: ************************************************ * the greedy student ate the loaf of french * * bread while the evil baker baked three more * * loaves of bread * ************************************************ bool ef_file(ifstream &in) { char word[20]; in >> word; while (!in.eof()) { if (!at_least_one('e','f',word)) return false; in >> word; } return true; } ------------------------------------------------------------------------------ Problem 3 (30 points): A. Define a class called person with private data fields for first name, last name and test_grade, plus a prototype for the public member function in part B of this question. class person { private: char first_name[20],last_name[20]; int test_grade; public: bool pass(); } B. Write a member function for person called pass which returns true if the person passed the test (at least 60), otherwise false. bool person::pass() { if (test_grade >= 60) return true; else return false; } C. Write a nonmember function called both_pass which takes two persons as parameters and returns true if both of the persons passed the test, otherwise false. bool both_pass(person p1, person p2) { if (p1.pass() && p2.pass()) return true; else return false; } ------------------------------------------------------------------------------