A list of exam scores (S) (in percent out of 100%) is given: 72, 81, 44, 68, 90,
ID: 3812829 • Letter: A
Question
A list of exam scores (S) (in percent out of 100%) is given: 72, 81, 44, 68, 90, 53, 80, 75, 74, 65, 50, 92, 85, 69, 41, 73, 70, 86, 61, 65, 79, 94, 69. Write a computer program that calculates the average (Av) and standard deviation (Sd) of the scores, which are rounded to the nearest integer. Then, the program determines the letter grade of each of the scores according to the following scheme: The program displays the values of Av and Sd followed by a list that shows the scores and the corresponding letter grade (e.g., 72% Letter grade C).Explanation / Answer
A=[72,81,44,68,90,53,80,75,74,65,50,92,85,69,41,73,70,86,61,65,79,94,69];
Av=mean(A);
Sd=std(A);
Av=round(Av);
Sd=round(Sd);
disp(Av);
disp(Sd);
for i=1:size(A,2)
if(A(i)>=(Av+(1.3*Sd)))
fprintf('%d letter grade A ',A(i))
elseif((Av+0.5*Sd)<=A(i))
fprintf('%d letter grade B ',A(i))
elseif((Av-0.5*Sd)<=A(i))
fprintf('%d letter grade C ',A(i))
elseif((Av-1.3*Sd)<=A(i))
fprintf('%d letter grade D ',A(i))
elseif((Av-1.3*Sd)>A(i))
fprintf('%d letter grade F ',A(i))
end
end
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.