Problem 1 (15 points) Write a function called calc_grade that takes three doubles as paramaters. The function calculates the sum of one quarter the first parameter, one quarter the second parameter, and one half the third parameter. Then it returns that sum. double calc_grade(double x, double y, double z) { return x/4.0 + y/4.0 + z/2.0; } ------------------------------------------------------------------------------ Problem 2 (15 points): Write a function called adjust_grade that takes a double and a character as parameter. The function should add 5 to the first parameter if the second parameter is a y. It does not return anything. void adjust_grade(double &x, char c) { if (c == 'y') x += 5.0; } ------------------------------------------------------------------------------ Problem 3 (40 points): Write a function called pass_class which has no parameters. The function reads in the grade of a person on two homework assignments and one exam. For each of the homeworks, it asks if the person handed it in early (answer y or n). It adds five points to the grade of each homework that is handed in early. Then it calculates the class grade of the person, using the adjusted homework grades and the exam grade. The scheme for computing the class grade is that the two adjusted homeworks are worth 25% and the exam is worth 50%. It returns true if the person passes the class and false if the person doesn't (A person needs a class grade of at least 60 to pass the class). [This function must call the functions from the previous two problems.] bool pass_class() { double homework1,homework2,exam,grade; char ans1,ans2; cout << "Give grade of first homework: "; cin >> homework1; cout << "Was it early? "; cin ans1; cout << "Give grade of second homework: "; cin >> homework2; cout << "Was it early? "; cin ans2; cout << "Give grade of exam: "; cin >> exam; adjust_grade(homework1,ans1); adjust_grade(homework2,ans2); grade = calc_grade(homework1,homework2,exam); if (grade >= 60) return true; else return false; } ------------------------------------------------------------------------------ Problem 4 (30 points): Write a program which reads in the homework and exam grades for 100 people, using the function from the previous problem. Then it prints out how many of the 100 people pass the class. int main() { double grades[100] int count = 0; int i; for (i=0; i<100; i++) if (pass_class()) count++; cout << count << " people passed the class\n"; return 0; } ------------------------------------------------------------------------------