Question: Quiz # 2 Write a Matlab user defined function that takes the letter grades (ie. AABBC) as input and returns if the student entitled to
Quiz # 2 Write a Matlab user defined function that takes the letter grades (ie. AABBC) as input and returns if the student entitled to the honor list or not. The student is considered in the honor list he or she satisfies the following three conditions: An average GPA of 3.5 and above. At least two classes with A mark. no class with a mark less than C(.e. no D or F). The function returns either 1 or 0. A returned value of one means the student is in the honor list and a value of zero means the student is not in the honor list. You function name should be isHonor. Write a simple script that test your function. The formulas are: We assume the following values for the letter grades, and the corresponding formula for the GPA: A = 5, B = 4, C = 3 (D and F do not matter, since if we encounter them, the function should immediately return 0) GPA = (sum of all letter grade scores)/(number of classes) = (sum of all letter grade scores)/(number of letter grades) Sample output > > >isHonor("AABBC") ans = 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
