SID Quiz Homework Project Test Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 HW1 HW2 HW3 HW4 HW
ID: 3719013 • Letter: S
Question
SID Quiz Homework Project Test Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 HW1 HW2 HW3 HW4 HW5 HW6 HW7 HW8 Mid-Term 1 Mid-Term 2 10 10 10 10 10 10 10 10 10 10 60 30 50 40 50 40 90 100 100 100 100 SID1 10 8 5 6.5 5 6.5 4 4 6 9 60 25 47 39.5 50 39.5 90 90 80 70 100 SID2 10 7 5.5 10 10 10 10 5 10 10 20 24 48 40 47 15 90 70 100 100 95 SID3 2 0 2 0 3 0 0 5 6 8 0 20 0 0 30 25 50 60 75 55 60 SID4 10 9 10 10 8.5 8 9.5 8 5 10 0 26 38 30 50 38 85 100 70 95 80 SID5 10 9 5 10 9 8 5.5 8 9 9 58 22 46 40 40 38.5 90 90 90 100 100 SID6 10 2 8 8 9.5 8 9 7 2 10 58 30 46 40 50 38 90 30 85 70 75 SID7 10 3 6 7.5 7.5 10 3.5 4 6 8 60 29 46 40 50 19 0 80 80 90 70 SID8 10 10 7 3 1 4 1 5 1 8 0 30 0 40 30 20 45 80 70 60 65 SID9 10 4 7 10 9 10 10 8 0 7 60 25 46 40 47 0 88 88 80 85 90 SID10 10 10 6.5 8 2 7.5 5.5 7 5 8 55 26 48 39 50 38 88 90 95 94 80 SID11 10 10 10 9.5 8 10 8 7 6 8 58 24 50 39.5 50 39.5 70 92 80 95 85 SID12 10 10 6 6.5 9.5 5 5 5 7 8 46 25 46 40 50 35 90 85 99 100 90 SID13 10 8 6 8.5 2.5 10 5 4 5 7.5 56 21 30 40 40 20 75 95 80 65 70 SID14 10 10 7 1 6 8 6.5 7 5 8 54 24 50 40 50 40 45 89 75 55 70 SID15 0 5 9 10 8.5 9.5 1 6 9.5 8 50 30 50 40 40 0 30 96 80 72 92 SID16 8 10 1 7 8 2 4 5 8 8 60 30 0 0 50 0 30 75 85 75 90 SID17 10 10 8 10 6 10 10 10 10 8.5 53 30 44 40 50 39 85 100 80 85 94 SID18 8 0 9 8.5 3 10 9 4 4 8 60 30 46 35 50 38 0 94 90 60 100 SID19 10 10 10 10 8 10 10 3 10 8 60 26 48 40 50 36 90 100 80 96 90 SID20 9 5 4 6 7.5 6.5 3.5 8 5 10 42 26 48 39.5 50 0 86 100 90 66 75 SID21 10 10 7 9.5 1 6 6 7 5 8 60 30 49 40 48 39 0 99 80 75 90 SID22 10 9 10 9 4 8 7.5 5 8 9 52 24 47 40 50 37 90 85 100 82 88 SID23 10 10 9.5 9 10 10 6 5 8 8 56 27 49 40 49 40 90 60 80 89 90 SID24 10 10 10 9.5 1 8 9.5 7 8 7 60 27 48 38 50 18 88 80 100 64 94 SID25 10 8 0 4.5 9 9 4.5 8 7 8 49 28 47 40 48.5 40 89 80 80 82 90 SID26 10 7 7 4.5 4.5 1 5 5 4 6 60 28 47 0 50 39 90 100 80 53 92 SID27 10 8 8 9 10 8 6 5 7 8 41 24 42 0 47 40 66 0 80 87 90 SID28 10 10 10 10 8 8 10 10 10 8 60 28 45 40 50 25 88 90 85 80 100 SID29 9 8 7 8 9 9.5 8.5 8 6 4 57 30 48 39 49.5 38 88 85 80 86 90 SID30 10 8 10 9 9 10 8 10 8 8 0 28 49 34 50 40 88 95 100 88 91 SID31 9 8 7 9.5 10 10 6 8 10 6 55 30 40 30 48 39 0 99 80 90 95 SID32 7 9 5 9 4 8 7.5 5 8 10 52 24 47 40 50 37 90 85 95 88 100 SID33 6 9 3 9 5 4 6 5 10 8 56 25 49 35 49 40 90 60 80 95 92 SID34 3 10 2 9 1 8 9.5 7 8 7 60 27 48 38 50 40 80 80 90 85 94 SID35 9 3 10 8 9 9 5 8 7 10 49 30 40 40 20 30 89 80 100 82 90 SID36 2 3 7 5 6 2 5 1 12 6 0 20 0 0 50 0 85 60 65 50 55 SID37 8 10 8 9 5 8 6 5 7 8 41 24 42 30 47 40 75 100 85 87 90 SID38 5 10 8 3 8 8 5 6 10 3 60 20 50 40 50 30 88 90 95 85 100 SID39 9 9 7 8 9 9.5 8.5 8 6 4 57 30 48 39 40 38 88 90 100 92 90 SID40 10 7 5 5 10 5 10 5 10 8 50 30 40 34 40 35 80 90 90 90 100 Problem1 Write a MATLAB script (code) that reads an input file containing all the scores of 40 students. The MATLAB code should also calculate the weighted average score (see the weights below) in percent and the assign a letter grade to each student per the following scale. Your code should write an output file to list all the letter grades for all 30 students Table 1. Weight of each score components Score Components ulzzes Homework assignments Midterm exam 1 Project Midterm exam 2 Weight 15% 15% 25% 15% Table 2 Letter grade Weighted AveragreLetter Grade (9%) 70-79 9% 60 -69.99%Explanation / Answer
Matlab script:--
file=load('student_grade.txt'); %load input file
fileID = fopen('grades.txt','w'); %open output file
[r c]=size(file); %size of input file
for i=1:r %for each student in file
quiz_sum=sum(file(i,1:10)); %sum of quizes
hw_sum=sum(file(i,11:18)); %sum of home works
project=file(i,19); %project marks
mid1=file(i,20); %mid1 marks
mid2=file(i,21); %mid2 marks
quiz_wt=15/100*quiz_sum; %quiz weight
hw_wt=15/100*hw_sum; %home work weight
proj_wt=15/100*project; %project weight
mid1_wt=25/100*mid1; %mid1 weight
mid2_wt=30/100*mid2; %mid2 weight
wt_avg_score=quiz_wt+hw_wt+proj_wt+mid1_wt+mid2_wt; %weighted average score
if wt_avg_score>=90
fprintf(fileID,'A '); %if score>=90
elseif wt_avg_score>=80 && wt_avg_score<90
fprintf(fileID,'B '); %if 80<=score<90
elseif wt_avg_score>=70 && wt_avg_score<80
fprintf(fileID,'C '); %if 70<=score<80
elseif wt_avg_score>=60 && wt_avg_score<70
fprintf(fileID,'D '); %if 60<=score<70
else
fprintf(fileID,'E '); %if score<60
end
end
fclose(fileID); %close opened file
input file:-- (in txt file format with spaces between scores with out student id, in this file 1st line is 1st student score, 2nd line is 2nd student score and so on. Here i am taking only 5 students you may take all the students but code need not to be change)
10 8 5 6.5 5 6.5 4 4 6 9 60 25 47 39.5 50 39.5 90 90 80 70 100
10 7 5.5 10 10 10 10 5 10 10 20 24 48 40 47 15 90 70 100 100 95
2 0 2 0 3 0 0 5 6 8 0 20 0 0 30 25 50 60 75 55 60
10 9 10 10 8.5 8 9.5 8 5 10 0 26 38 30 50 38 85 100 70 95 80
10 9 5 10 9 8 5.5 8 9 9 58 22 46 40 40 38.5 90 90 90 100 100
output:-- (this also a txt file here 1st letter is 1st student grade and 2nd letter is 2nd student grade)
A A C A A
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.