------------------------------------------------------------------------------ Problem 1 (30 points): A. Write a function called largest, which takes an array of integers and its size as parameters. The function should return the largest number in the array. B. Assume I'm teaching a senior-level course which has two students, Ann and Bill. The course has 15 homework assignments, and the scores on these assignments will determine Ann and Bill's course grade in the following way: At the end of the semester I will look at all their homework scores and give an A to the person who got the highest single homework score, and an F to the other person (no matter how well they did --- I'm cruel). So, for example, if Ann got 100% on one assignment and 10% on all others, while Bill got 95% on every assignment, Ann would get the A while Bill would get the F. Using the function in part A, write a program that asks the user for all of Ann's and Bill's homework scores, and then prints out the person who gets the A course grade. ------------------------------------------------------------------------------ Problem 2 (20 points): Write a function called ab which takes a string as parameter. The function should return true if that string contains an 'a' and a 'b', and some 'a' in the string appears before some 'b', but it doesn't have to be directly before it. Otherwise it returns false. Examples follow: If the string is Then it returns ---------------- --------------- grabba true caramba true banana false anana false bob false ------------------------------------------------------------------------------ Problem 3 (20 points): Write a function called same_initial that has an input stream and an output stream as parameters. The input stream is already associated with a file of first and last names (each line in the file contains a first name and a last name separated by a space), and the output stream is also already associated with a file. Your function should make the file associated with the output stream contain all the names in the input file where the first and last name begin with the same letter. In other words, if "Jane Jones" is in the input file then it should be in the output file. But if "Kevin Jones" is in the input file then it should not be in the output file. Your output file should be in the same format as the input file. ------------------------------------------------------------------------------ Problem 4 (30 points): A. Define a class called person whose private data members are a first name, a last name, and the scores of two tests. See part B of this question to see what function prototype should appear in the public section. B. Write a member function for person which returns the average of that person's two test scores. The name of your function is avg. C. Using what you have defined in parts A and B, write a nonmember function called higher_avg which takes two persons as parameters and returns true if the first person has a higher average on the two tests than the second person, false otherwise. Please note that this must be a nonmember function. ------------------------------------------------------------------------------