Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a function called class Average that takes in an array of numbers and, aft

ID: 3533682 • Letter: W

Question

Write a function called class Average that takes in an array of numbers and, after normalizing the grades in such a way that the highest corresponds to 100, returns the letter grade of the class average. This curve is the same method used to generate normTests in Chapter Problem 2. The grade ranges are as follows:

average>=90 => A

80<= average< 90 => B

70<= average< 80 => C

60<= average< 70 => D

average< 60 => F

For example: classAverage( [7087 95 80 80 78 85 90 66 89 89 100] ) should return B

Test your program for the following two cases:

classAverage( [5090 61 82 75 92 81 76 87 41 31 98] )

classAverage( [1010 11 32 53 12 34 74 31 30 26 22] )

Explanation / Answer

function letter=classAverage(grades)

highest=max(grades);

factor=100/highest;

  

fgrades=factor*grades;

ave=mean(fgrades);

  

switch(round(ave/10))

case {9,10}

letter='A';

case 8

letter='B';

case 7

letter='C';

case 6

letter='D';

otherwise

letter='F';

end

end

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote