yhe opn er.taf uun tot he test question You may a You want to automate grading t
ID: 3714885 • Letter: Y
Question
yhe opn er.taf uun tot he test question You may a You want to automate grading the multiple choice part of an exam, and the answers are in a file. Open the open file test3_Answers.txt, using the file handle inFile. Populate an array called test3Answers which will contain the correct answers to the test questions. You may assume one answer on each line of the input file. 5. Next, determine the number of questions student1 has gotten correct, and whether or not he/she passed the exam. A passing grade is any score 21 or greater (60%). student 1-('A', 'B','D', 'D', 'D', 'C','C','A', 'B','B','C','A', . . ., ?','A','D'); index = 1; %index used to populate test3Answers test3Answers-l correct = 0; while "feof(inFile) oneGrade-fgetl (in File); %populate test3Answers arrayExplanation / Answer
SOurceCode:
student1={'A','B','D','D','D','C','C','A','B','B','C','A','A','A','D'};
index=1;
test3answers={};
correct=0;
while~feof(inFile)
> test3answers(index)=onegrade;
end
for i=1:size(test3answers,2)
if(test3answers(i)==student1(i))
correct=correct+1;
end
end
if(correct>=21)
fprintf('passed')
else
fprintf('end')
end
---------------------------------------
fifty=zeros(1,50);
for i=1:235
num=randi(50);
fifty(num)=fifty(num)+1;
end
display(fifty)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.