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

the opn file tests3 Answers-tat. uwes to the test questions: You mav You want to

ID: 3719456 • Letter: T

Question

the opn file tests3 Answers-tat. uwes to the test questions: You mav 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%). index-1; %index used to populate test3Answers test3Answers- correct 0; while feof(inFile) oneGrade-fgetl(inFilel; %populate test3Answers array

Explanation / 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)