Question: 11. Write a user-defined function that calculates grade point average (GPA) on a scale of 0 to 5, where , , , , and .
11. Write a user-defined function that calculates grade point average (GPA) on a scale of 0 to 5, where , , , , and . For the function name and arguments, use GPA = GradePtAve(G,C). The input argument G is a vector whose elements are letter grades A, B, C, D, or F entered as a string (e.g., [‘ABACFB’]). The input argument C is a vector with the corresponding credit hours. The output argument GPA is the calculated GPA rounded to the nearest tenth (i.e., 3.75 is rounded to 3.8, and 3.749 is rounded to 3.7). Use the function to calculate the GPA for a student with the following record:
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
