Script file called problem4 which will enable a student 10 the semester. Your pr
ID: 645031 • Letter: S
Question
Script file called problem4 which will enable a student 10 the semester. Your program has to input student data stored in an EXCEL file. The file contains data on course number, course units, and the student score in the course. The rule for assigning letter grades based on course scores is as follows: If the score is 85 or more, is A, if the score is between 70 and 85 the grade is B. if the score is between 55 and 70 the is C, if the score is between 40 and 55 the grade is D. and for a score below 40 the grade is F. The grade points associated with the grades are A=4, B=3, C=2, D=1 and F=0. Test your program with the following sample data (you need to create the EXCEL file).Explanation / Answer
path='';%Enter the location of EXCEL file
a=xlsread(path);
len=length(a(1,:));
grade=zeros(1,len);
for i=1:len
if(a(3,i)>=85)
grade(i)=4;
elseif(a(3,i)>=70)
grade(i)=3;
elseif(a(3,i)>=55)
grade(i)=2;
elseif(a(3,i)>=40)
grade(i)=1;
else
grade(i)=0;
end
end
gpa=sum(a(2,:).*grade)/sum(a(2,:));
fprintf('%f ',gpa);
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.